aloha_analyzer 0.4.1 → 0.4.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: 3869d7aa9079ebe62bfc5ad8b91b3d05927611df
4
- data.tar.gz: 2a8d0b981a38b7f026d48c94e407a26945c7508d
3
+ metadata.gz: b06a694c3bc71c5bb5a64f4b3b19da403a8675e8
4
+ data.tar.gz: 8701c32f2590721c7d35f6762c5da42263176beb
5
5
  SHA512:
6
- metadata.gz: 7b57fb1039a935bae1bbc108f72628738c20e2f955c8c8ba20cdd6a33e0221698801ea59c8c2568aa5fa4f5754f90725a8b15036aacf0a9b1a5369533195f8f2
7
- data.tar.gz: fd3cd8b4ef9191fe0af77636d2e56258692c9a1ca48dc4e6474466818fdbf17b8819296964b2cdf748411ddd5f8fb05cbcf2d1d2294f1aa21585f062b1aebec9
6
+ metadata.gz: abaf15344a29141864b3d550313486f3b1ee85e8b4bdcffe6cd86741e001da9f6a73173197a8ded6ffa147bed7cbe359b7f1428ce808e25fc0336b325ad5cebf
7
+ data.tar.gz: 0b395f8911cf4eac948878f7573eec1cb0faf79877aa2f6c6841343f791a86c5b287a3b554127b54eac8d1c098a17d6267cd0ef389e389f54cb7daeaedefad56
@@ -18,8 +18,9 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.add_development_dependency 'twitter_cldr', '~> 3.0'
21
22
  spec.add_development_dependency 'bundler', '~> 1.3'
22
23
  spec.add_development_dependency 'rake', '~> 10.3'
23
24
  spec.add_development_dependency 'rspec', '~> 2.14'
24
- spec.add_development_dependency 'debugger', '~> 1.6'
25
+ spec.add_development_dependency 'byebug', '~> 3.1'
25
26
  end
@@ -3,11 +3,12 @@ require 'yaml'
3
3
  module AlohaAnalyzer
4
4
  class Language
5
5
 
6
- LANGUAGES = YAML::load_file(File.join(File.dirname(__FILE__), 'yaml/language.yml'))
6
+ LANGUAGES = YAML::load_file(File.join(File.dirname(__FILE__), 'yaml/languages.yml'))
7
+ ALIASES = YAML::load_file(File.join(File.dirname(__FILE__), 'yaml/aliases.yml'))
7
8
  TOTAL_POPULATION = 790000000
8
9
 
9
10
  def self.all
10
- LANGUAGES
11
+ LANGUAGES['languages']
11
12
  end
12
13
 
13
14
  def self.total
@@ -15,23 +16,15 @@ module AlohaAnalyzer
15
16
  end
16
17
 
17
18
  def self.aliases
18
- {
19
- 'en-gb' => 'en',
20
- 'zh-cn' => 'zh',
21
- 'zh-tw' => 'zh',
22
- 'zh-Hans' => 'zh',
23
- 'ca' => 'es',
24
- 'xx-lc' => 'en',
25
- 'gl' => 'es',
26
- 'eu' => 'es'
27
- }
19
+ ALIASES['aliases']
28
20
  end
29
21
 
30
22
  def self.find_by_abbreviation(abbreviation)
31
- all.each do |language|
32
- return language if language['abbreviation'] == abbreviation
23
+ if LANGUAGES['languages'][abbreviation]
24
+ LANGUAGES['languages'][abbreviation]
25
+ else
26
+ raise "Could not find language abbreviation '#{abbreviation}'"
33
27
  end
34
- raise "Could not find language abbreviation '#{abbreviation}'"
35
28
  end
36
29
  end
37
30
  end
@@ -1,3 +1,3 @@
1
1
  module AlohaAnalyzer
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.2'
3
3
  end
@@ -0,0 +1,559 @@
1
+ aliases:
2
+ 'ace': 'zh'
3
+ 'ang': 'en'
4
+ 'ar-001': 'ar'
5
+ 'ca': 'es'
6
+ 'cpe': 'en'
7
+ 'cpf': 'fr'
8
+ 'cpp': 'pt'
9
+ 'crh': 'tr'
10
+ 'de-at': 'de'
11
+ 'de-ch': 'de'
12
+ 'dum': 'nl'
13
+ 'en-au': 'en'
14
+ 'en-ca': 'en'
15
+ 'en-gb': 'en'
16
+ 'en-us': 'en'
17
+ 'enm': 'en'
18
+ 'es-419': 'es'
19
+ 'es-es': 'es'
20
+ 'es-mx': 'es'
21
+ 'eu': 'es'
22
+ 'fr-ca': 'fr'
23
+ 'fr-ch': 'fr'
24
+ 'frm': 'fr'
25
+ 'fro': 'fr'
26
+ 'gem': 'de'
27
+ 'gl': 'es'
28
+ 'gmh': 'de'
29
+ 'goh': 'de'
30
+ 'gsw': 'de'
31
+ 'jpr': 'fa'
32
+ 'jrb': 'ar'
33
+ 'jv': 'id'
34
+ 'msa': 'ms'
35
+ 'nb': 'no'
36
+ 'nds': 'de'
37
+ 'nn': 'no'
38
+ 'ota': 'tr'
39
+ 'peo': 'fa'
40
+ 'pt-br': 'pt'
41
+ 'pt-pt': 'pt'
42
+ 'shu': 'ar'
43
+ 'tl': 'fil'
44
+ 'xx-lc': 'en'
45
+ 'zh-cn': 'zh'
46
+ 'zh-hans': 'zh'
47
+ 'zh-hant': 'zh'
48
+ 'zh-tw': 'zh'
49
+ # 'aa': 'afar'
50
+ # 'ab': 'abkhazian'
51
+ # 'ach': 'acoli'
52
+ # 'ada': 'adangme'
53
+ # 'ady': 'adyghe'
54
+ # 'ae': 'avestan'
55
+ # 'af': 'afrikaans'
56
+ # 'afa': 'afro-asiatic language'
57
+ # 'afh': 'afrihili'
58
+ # 'agq': 'aghem'
59
+ # 'ain': 'ainu'
60
+ # 'ak': 'akan'
61
+ # 'akk': 'akkadian'
62
+ # 'ale': 'aleut'
63
+ # 'alg': 'algonquian language'
64
+ # 'alt': 'southern altai'
65
+ # 'am': 'amharic'
66
+ # 'an': 'aragonese'
67
+ # 'anp': 'angika'
68
+ # 'apa': 'apache language'
69
+ # 'arc': 'aramaic'
70
+ # 'arn': 'mapuche'
71
+ # 'arp': 'arapaho'
72
+ # 'art': 'artificial language'
73
+ # 'arw': 'arawak'
74
+ # 'as': 'assamese'
75
+ # 'asa': 'asu'
76
+ # 'ast': 'asturian'
77
+ # 'ath': 'athapascan language'
78
+ # 'aus': 'australian language'
79
+ # 'av': 'avaric'
80
+ # 'awa': 'awadhi'
81
+ # 'ay': 'aymara'
82
+ # 'az': 'azeri'
83
+ # 'ba': 'bashkir'
84
+ # 'bad': 'banda'
85
+ # 'bai': 'bamileke language'
86
+ # 'bal': 'baluchi'
87
+ # 'ban': 'balinese'
88
+ # 'bas': 'basaa'
89
+ # 'bat': 'baltic language'
90
+ # 'bax': 'bamun'
91
+ # 'bbj': 'ghomala'
92
+ # 'be': 'belarusian'
93
+ # 'bej': 'beja'
94
+ # 'bem': 'bemba'
95
+ # 'ber': 'berber'
96
+ # 'bez': 'bena'
97
+ # 'bfd': 'bafut'
98
+ # 'bg': 'bulgarian'
99
+ # 'bh': 'bihari'
100
+ # 'bho': 'bhojpuri'
101
+ # 'bi': 'bislama'
102
+ # 'bik': 'bikol'
103
+ # 'bin': 'bini'
104
+ # 'bkm': 'kom'
105
+ # 'bla': 'siksika'
106
+ # 'bm': 'bambara'
107
+ # 'bn': 'bengali'
108
+ # 'bnt': 'bantu'
109
+ # 'bo': 'tibetan'
110
+ # 'br': 'breton'
111
+ # 'bra': 'braj'
112
+ # 'brx': 'bodo'
113
+ # 'bs': 'bosnian'
114
+ # 'bss': 'akoose'
115
+ # 'btk': 'batak'
116
+ # 'bua': 'buriat'
117
+ # 'bug': 'buginese'
118
+ # 'bum': 'bulu'
119
+ # 'byn': 'blin'
120
+ # 'byv': 'medumba'
121
+ # 'cad': 'caddo'
122
+ # 'cai': 'central american indian language'
123
+ # 'car': 'carib'
124
+ # 'cau': 'caucasian language'
125
+ # 'cay': 'cayuga'
126
+ # 'cch': 'atsam'
127
+ # 'ce': 'chechen'
128
+ # 'ceb': 'cebuano'
129
+ # 'cel': 'celtic language'
130
+ # 'cgg': 'chiga'
131
+ # 'ch': 'chamorro'
132
+ # 'chb': 'chibcha'
133
+ # 'chg': 'chagatai'
134
+ # 'chk': 'chuukese'
135
+ # 'chm': 'mari'
136
+ # 'chn': 'chinook jargon'
137
+ # 'cho': 'choctaw'
138
+ # 'chp': 'chipewyan'
139
+ # 'chr': 'cherokee'
140
+ # 'chy': 'cheyenne'
141
+ # 'ckb': 'sorani kurdish'
142
+ # 'cmc': 'chamic language'
143
+ # 'co': 'corsican'
144
+ # 'cop': 'coptic'
145
+ # 'cr': 'cree'
146
+ # 'crp': 'creole or pidgin'
147
+ # 'csb': 'kashubian'
148
+ # 'cu': 'church slavic'
149
+ # 'cus': 'cushitic language'
150
+ # 'cv': 'chuvash'
151
+ # 'cy': 'welsh'
152
+ # 'dak': 'dakota'
153
+ # 'dar': 'dargwa'
154
+ # 'dav': 'taita'
155
+ # 'day': 'dayak'
156
+ # 'del': 'delaware'
157
+ # 'den': 'slave'
158
+ # 'dgr': 'dogrib'
159
+ # 'din': 'dinka'
160
+ # 'dje': 'zarma'
161
+ # 'doi': 'dogri'
162
+ # 'dra': 'dravidian language'
163
+ # 'dsb': 'lower sorbian'
164
+ # 'dua': 'duala'
165
+ # 'dv': 'divehi'
166
+ # 'dyo': 'jola-fonyi'
167
+ # 'dyu': 'dyula'
168
+ # 'dz': 'dzongkha'
169
+ # 'dzg': 'dazaga'
170
+ # 'ebu': 'embu'
171
+ # 'ee': 'ewe'
172
+ # 'efi': 'efik'
173
+ # 'egy': 'ancient egyptian'
174
+ # 'eka': 'ekajuk'
175
+ # 'el': 'greek'
176
+ # 'elx': 'elamite'
177
+ # 'eo': 'esperanto'
178
+ # 'et': 'estonian'
179
+ # 'eu': 'basque'
180
+ # 'ewo': 'ewondo'
181
+ # 'fan': 'fang'
182
+ # 'fat': 'fanti'
183
+ # 'ff': 'fulah'
184
+ # 'fiu': 'finno-ugrian language'
185
+ # 'fj': 'fijian'
186
+ # 'fo': 'faroese'
187
+ # 'fon': 'fon'
188
+ # 'frr': 'northern frisian'
189
+ # 'frs': 'eastern frisian'
190
+ # 'fur': 'friulian'
191
+ # 'fy': 'western frisian'
192
+ # 'ga': 'irish'
193
+ # 'gaa': 'ga'
194
+ # 'gay': 'gayo'
195
+ # 'gba': 'gbaya'
196
+ # 'gd': 'scottish gaelic'
197
+ # 'gez': 'geez'
198
+ # 'gil': 'gilbertese'
199
+ # 'gl': 'galician'
200
+ # 'gn': 'guarani'
201
+ # 'gon': 'gondi'
202
+ # 'gor': 'gorontalo'
203
+ # 'got': 'gothic'
204
+ # 'grb': 'grebo'
205
+ # 'grc': 'ancient greek'
206
+ # 'gu': 'gujarati'
207
+ # 'guz': 'gusii'
208
+ # 'gv': 'manx'
209
+ # 'gwi': 'gwichʼin'
210
+ # 'ha': 'hausa'
211
+ # 'hai': 'haida'
212
+ # 'haw': 'hawaiian'
213
+ # 'he': 'hebrew'
214
+ # 'hil': 'hiligaynon'
215
+ # 'him': 'himachali'
216
+ # 'hit': 'hittite'
217
+ # 'hmn': 'hmong'
218
+ # 'ho': 'hiri motu'
219
+ # 'hr': 'croatian'
220
+ # 'hsb': 'upper sorbian'
221
+ # 'ht': 'haitian'
222
+ # 'hup': 'hupa'
223
+ # 'hy': 'armenian'
224
+ # 'hz': 'herero'
225
+ # 'ia': 'interlingua'
226
+ # 'iba': 'iban'
227
+ # 'ibb': 'ibibio'
228
+ # 'ie': 'interlingue'
229
+ # 'ig': 'igbo'
230
+ # 'ii': 'sichuan yi'
231
+ # 'ijo': 'ijo'
232
+ # 'ik': 'inupiaq'
233
+ # 'ilo': 'iloko'
234
+ # 'inc': 'indic language'
235
+ # 'ine': 'indo-european language'
236
+ # 'inh': 'ingush'
237
+ # 'io': 'ido'
238
+ # 'ira': 'iranian language'
239
+ # 'iro': 'iroquoian language'
240
+ # 'is': 'icelandic'
241
+ # 'iu': 'inuktitut'
242
+ # 'jbo': 'lojban'
243
+ # 'jgo': 'ngomba'
244
+ # 'jmc': 'machame'
245
+ # 'ka': 'georgian'
246
+ # 'kaa': 'kara-kalpak'
247
+ # 'kab': 'kabyle'
248
+ # 'kac': 'kachin'
249
+ # 'kaj': 'jju'
250
+ # 'kam': 'kamba'
251
+ # 'kar': 'karen'
252
+ # 'kaw': 'kawi'
253
+ # 'kbd': 'kabardian'
254
+ # 'kbl': 'kanembu'
255
+ # 'kcg': 'tyap'
256
+ # 'kde': 'makonde'
257
+ # 'kea': 'kabuverdianu'
258
+ # 'kfo': 'koro'
259
+ # 'kg': 'kongo'
260
+ # 'kha': 'khasi'
261
+ # 'khi': 'khoisan language'
262
+ # 'kho': 'khotanese'
263
+ # 'khq': 'koyra chiini'
264
+ # 'ki': 'kikuyu'
265
+ # 'kj': 'kuanyama'
266
+ # 'kk': 'kazakh'
267
+ # 'kkj': 'kako'
268
+ # 'kl': 'kalaallisut'
269
+ # 'kln': 'kalenjin'
270
+ # 'km': 'khmer'
271
+ # 'kmb': 'kimbundu'
272
+ # 'kn': 'kannada'
273
+ # 'kok': 'konkani'
274
+ # 'kos': 'kosraean'
275
+ # 'kpe': 'kpelle'
276
+ # 'kr': 'kanuri'
277
+ # 'krc': 'karachay-balkar'
278
+ # 'krl': 'karelian'
279
+ # 'kro': 'kru'
280
+ # 'kru': 'kurukh'
281
+ # 'ks': 'kashmiri'
282
+ # 'ksb': 'shambala'
283
+ # 'ksf': 'bafia'
284
+ # 'ksh': 'colognian'
285
+ # 'ku': 'kurdish'
286
+ # 'kum': 'kumyk'
287
+ # 'kut': 'kutenai'
288
+ # 'kv': 'komi'
289
+ # 'kw': 'cornish'
290
+ # 'ky': 'kirghiz'
291
+ # 'la': 'latin'
292
+ # 'lad': 'ladino'
293
+ # 'lag': 'langi'
294
+ # 'lah': 'lahnda'
295
+ # 'lam': 'lamba'
296
+ # 'lb': 'luxembourgish'
297
+ # 'lez': 'lezghian'
298
+ # 'lg': 'ganda'
299
+ # 'li': 'limburgish'
300
+ # 'lkt': 'lakota'
301
+ # 'ln': 'lingala'
302
+ # 'lo': 'lao'
303
+ # 'lol': 'mongo'
304
+ # 'loz': 'lozi'
305
+ # 'lt': 'lithuanian'
306
+ # 'lu': 'luba-katanga'
307
+ # 'lua': 'luba-lulua'
308
+ # 'lui': 'luiseno'
309
+ # 'lun': 'lunda'
310
+ # 'luo': 'luo'
311
+ # 'lus': 'mizo'
312
+ # 'luy': 'luyia'
313
+ # 'lv': 'latvian'
314
+ # 'mad': 'madurese'
315
+ # 'maf': 'mafa'
316
+ # 'mag': 'magahi'
317
+ # 'mai': 'maithili'
318
+ # 'mak': 'makasar'
319
+ # 'man': 'mandingo'
320
+ # 'map': 'austronesian language'
321
+ # 'mas': 'masai'
322
+ # 'mde': 'maba'
323
+ # 'mdf': 'moksha'
324
+ # 'mdr': 'mandar'
325
+ # 'men': 'mende'
326
+ # 'mer': 'meru'
327
+ # 'mfe': 'morisyen'
328
+ # 'mg': 'malagasy'
329
+ # 'mga': 'middle irish'
330
+ # 'mgh': 'makhuwa-meetto'
331
+ # 'mgo': 'meta''
332
+ # 'mh': 'marshallese'
333
+ # 'mi': 'maori'
334
+ # 'mic': 'micmac'
335
+ # 'min': 'minangkabau'
336
+ # 'mis': 'miscellaneous language'
337
+ # 'mk': 'macedonian'
338
+ # 'mkh': 'mon-khmer language'
339
+ # 'ml': 'malayalam'
340
+ # 'mn': 'mongolian'
341
+ # 'mnc': 'manchu'
342
+ # 'mni': 'manipuri'
343
+ # 'mno': 'manobo language'
344
+ # 'mo': 'moldavian'
345
+ # 'moh': 'mohawk'
346
+ # 'mos': 'mossi'
347
+ # 'mr': 'marathi'
348
+ # 'mt': 'maltese'
349
+ # 'mua': 'mundang'
350
+ # 'mul': 'multiple languages'
351
+ # 'mun': 'munda language'
352
+ # 'mus': 'creek'
353
+ # 'mwl': 'mirandese'
354
+ # 'mwr': 'marwari'
355
+ # 'my': 'burmese'
356
+ # 'mye': 'myene'
357
+ # 'myn': 'mayan language'
358
+ # 'myv': 'erzya'
359
+ # 'na': 'nauru'
360
+ # 'nah': 'nahuatl'
361
+ # 'nai': 'north american indian language'
362
+ # 'nap': 'neapolitan'
363
+ # 'naq': 'nama'
364
+ # 'nd': 'north ndebele'
365
+ # 'ne': 'nepali'
366
+ # 'new': 'newari'
367
+ # 'ng': 'ndonga'
368
+ # 'nia': 'nias'
369
+ # 'nic': 'niger-kordofanian language'
370
+ # 'niu': 'niuean'
371
+ # 'nl-be': 'flemish'
372
+ # 'nmg': 'kwasio'
373
+ # 'nnh': 'ngiemboon'
374
+ # 'nog': 'nogai'
375
+ # 'non': 'old norse'
376
+ # 'nqo': 'n’ko'
377
+ # 'nr': 'south ndebele'
378
+ # 'nso': 'northern sotho'
379
+ # 'nub': 'nubian language'
380
+ # 'nus': 'nuer'
381
+ # 'nv': 'navajo'
382
+ # 'nwc': 'classical newari'
383
+ # 'ny': 'nyanja'
384
+ # 'nym': 'nyamwezi'
385
+ # 'nyn': 'nyankole'
386
+ # 'nyo': 'nyoro'
387
+ # 'nzi': 'nzima'
388
+ # 'oc': 'occitan'
389
+ # 'oj': 'ojibwa'
390
+ # 'om': 'oromo'
391
+ # 'or': 'oriya'
392
+ # 'os': 'ossetic'
393
+ # 'osa': 'osage'
394
+ # 'oto': 'otomian language'
395
+ # 'pa': 'punjabi'
396
+ # 'paa': 'papuan language'
397
+ # 'pag': 'pangasinan'
398
+ # 'pal': 'pahlavi'
399
+ # 'pam': 'pampanga'
400
+ # 'pap': 'papiamento'
401
+ # 'pau': 'palauan'
402
+ # 'phi': 'philippine language'
403
+ # 'phn': 'phoenician'
404
+ # 'pi': 'pali'
405
+ # 'pon': 'pohnpeian'
406
+ # 'pra': 'prakrit language'
407
+ # 'pro': 'old provençal'
408
+ # 'ps': 'pushto'
409
+ # 'qu': 'quechua'
410
+ # 'raj': 'rajasthani'
411
+ # 'rap': 'rapanui'
412
+ # 'rar': 'rarotongan'
413
+ # 'rm': 'romansh'
414
+ # 'rn': 'rundi'
415
+ # 'roa': 'romance language'
416
+ # 'rof': 'rombo'
417
+ # 'rom': 'romany'
418
+ # 'root': 'root'
419
+ # 'rup': 'aromanian'
420
+ # 'rw': 'kinyarwanda'
421
+ # 'rwk': 'rwa'
422
+ # 'sa': 'sanskrit'
423
+ # 'sad': 'sandawe'
424
+ # 'sah': 'sakha'
425
+ # 'sai': 'south american indian language'
426
+ # 'sal': 'salishan language'
427
+ # 'sam': 'samaritan aramaic'
428
+ # 'saq': 'samburu'
429
+ # 'sas': 'sasak'
430
+ # 'sat': 'santali'
431
+ # 'sba': 'ngambay'
432
+ # 'sbp': 'sangu'
433
+ # 'sc': 'sardinian'
434
+ # 'scn': 'sicilian'
435
+ # 'sco': 'scots'
436
+ # 'sd': 'sindhi'
437
+ # 'se': 'northern sami'
438
+ # 'see': 'seneca'
439
+ # 'seh': 'sena'
440
+ # 'sel': 'selkup'
441
+ # 'sem': 'semitic language'
442
+ # 'ses': 'koyraboro senni'
443
+ # 'sg': 'sango'
444
+ # 'sga': 'old irish'
445
+ # 'sgn': 'sign language'
446
+ # 'sh': 'serbo-croatian'
447
+ # 'shi': 'tachelhit'
448
+ # 'shn': 'shan'
449
+ # 'si': 'sinhala'
450
+ # 'sid': 'sidamo'
451
+ # 'sio': 'siouan language'
452
+ # 'sit': 'sino-tibetan language'
453
+ # 'sk': 'slovak'
454
+ # 'sl': 'slovenian'
455
+ # 'sla': 'slavic language'
456
+ # 'sm': 'samoan'
457
+ # 'sma': 'southern sami'
458
+ # 'smi': 'sami language'
459
+ # 'smj': 'lule sami'
460
+ # 'smn': 'inari sami'
461
+ # 'sms': 'skolt sami'
462
+ # 'sn': 'shona'
463
+ # 'snk': 'soninke'
464
+ # 'so': 'somali'
465
+ # 'sog': 'sogdien'
466
+ # 'son': 'songhai'
467
+ # 'sq': 'albanian'
468
+ # 'sr': 'serbian'
469
+ # 'srn': 'sranan tongo'
470
+ # 'srr': 'serer'
471
+ # 'ss': 'swati'
472
+ # 'ssa': 'nilo-saharan language'
473
+ # 'ssy': 'saho'
474
+ # 'st': 'southern sotho'
475
+ # 'su': 'sundanese'
476
+ # 'suk': 'sukuma'
477
+ # 'sus': 'susu'
478
+ # 'sux': 'sumerian'
479
+ # 'sv': 'swedish'
480
+ # 'sw': 'swahili'
481
+ # 'swb': 'comorian'
482
+ # 'swc': 'congo swahili'
483
+ # 'syc': 'classical syriac'
484
+ # 'syr': 'syriac'
485
+ # 'ta': 'tamil'
486
+ # 'tai': 'tai language'
487
+ # 'te': 'telugu'
488
+ # 'tem': 'timne'
489
+ # 'teo': 'teso'
490
+ # 'ter': 'tereno'
491
+ # 'tet': 'tetum'
492
+ # 'tg': 'tajik'
493
+ # 'ti': 'tigrinya'
494
+ # 'tig': 'tigre'
495
+ # 'tiv': 'tiv'
496
+ # 'tk': 'turkmen'
497
+ # 'tkl': 'tokelau'
498
+ # 'tlh': 'klingon'
499
+ # 'tli': 'tlingit'
500
+ # 'tmh': 'tamashek'
501
+ # 'tn': 'tswana'
502
+ # 'to': 'tongan'
503
+ # 'tog': 'nyasa tonga'
504
+ # 'tpi': 'tok pisin'
505
+ # 'trv': 'taroko'
506
+ # 'ts': 'tsonga'
507
+ # 'tsi': 'tsimshian'
508
+ # 'tt': 'tatar'
509
+ # 'tum': 'tumbuka'
510
+ # 'tup': 'tupi language'
511
+ # 'tut': 'altaic language'
512
+ # 'tvl': 'tuvalu'
513
+ # 'tw': 'twi'
514
+ # 'twq': 'tasawaq'
515
+ # 'ty': 'tahitian'
516
+ # 'tyv': 'tuvinian'
517
+ # 'tzm': 'central atlas tamazight'
518
+ # 'udm': 'udmurt'
519
+ # 'ug': 'uighur'
520
+ # 'uga': 'ugaritic'
521
+ # 'umb': 'umbundu'
522
+ # 'und': 'unknown language'
523
+ # 'ur': 'urdu'
524
+ # 'uz': 'uzbek'
525
+ # 'vai': 'vai'
526
+ # 've': 'venda'
527
+ # 'vi': 'vietnamese'
528
+ # 'vo': 'volapük'
529
+ # 'vot': 'votic'
530
+ # 'vun': 'vunjo'
531
+ # 'wa': 'walloon'
532
+ # 'wae': 'walser'
533
+ # 'wak': 'wakashan language'
534
+ # 'wal': 'wolaytta'
535
+ # 'war': 'waray'
536
+ # 'was': 'washo'
537
+ # 'wen': 'sorbian language'
538
+ # 'wo': 'wolof'
539
+ # 'xal': 'kalmyk'
540
+ # 'xh': 'xhosa'
541
+ # 'xog': 'soga'
542
+ # 'yao': 'yao'
543
+ # 'yap': 'yapese'
544
+ # 'yav': 'yangben'
545
+ # 'ybb': 'yemba'
546
+ # 'yi': 'yiddish'
547
+ # 'yo': 'yoruba'
548
+ # 'ypk': 'yupik language'
549
+ # 'yue': 'cantonese'
550
+ # 'za': 'zhuang'
551
+ # 'zap': 'zapotec'
552
+ # 'zbl': 'blissymbols'
553
+ # 'zen': 'zenaga'
554
+ # 'zgh': 'standard moroccan tamazight'
555
+ # 'znd': 'zande'
556
+ # 'zu': 'zulu'
557
+ # 'zun': 'zuni'
558
+ # 'zxx': 'no linguistic content'
559
+ # 'zza': 'zaza'
@@ -0,0 +1,187 @@
1
+ languages:
2
+ 'fr':
3
+ abbreviation: 'fr'
4
+ name: French
5
+ population: 14_000_000
6
+ countries: 'France, Canada, Belgium, Switzerland'
7
+ greeting: 'bonjour!'
8
+ 'en':
9
+ abbreviation: 'en'
10
+ name: English
11
+ population: 238_000_000
12
+ countries: 'USA, UK, Canada, Ireland, Australia'
13
+ greeting: 'hello!'
14
+ 'ar':
15
+ abbreviation: 'ar'
16
+ name: Arabic
17
+ population: 42_000_000
18
+ countries: 'Egypt, Tunisia, Lebanon, United Arab Emirates'
19
+ greeting: 'مرحبا!'
20
+ 'ja':
21
+ abbreviation: 'ja'
22
+ name: Japanese
23
+ population: 106_580_000
24
+ countries: 'Japan, Brazil'
25
+ greeting: '今日は!'
26
+ 'es':
27
+ abbreviation: 'es'
28
+ name: Spanish
29
+ population: 95_000_000
30
+ countries: 'Spain, Mexico, Argentina, Chile'
31
+ greeting: '¡hola!'
32
+ 'de':
33
+ abbreviation: 'de'
34
+ name: German
35
+ population: 5_000_000
36
+ countries: 'Germany, Austria, Switzerland, Belgium'
37
+ greeting: 'hallo!'
38
+ 'it':
39
+ abbreviation: 'it'
40
+ name: Italian
41
+ population: 8_000_000
42
+ countries: 'Italy, Switzerland, Malta'
43
+ greeting: 'ciao!'
44
+ 'id':
45
+ abbreviation: 'id'
46
+ name: Indonesian
47
+ population: 20_000_000
48
+ countries: 'Indonesia'
49
+ greeting: 'halo!'
50
+ 'pt':
51
+ abbreviation: 'pt'
52
+ name: Portuguese
53
+ population: 42_000_000
54
+ countries: 'Portugal, Brazil, Macau'
55
+ greeting: 'olá!'
56
+ 'ko':
57
+ abbreviation: 'ko'
58
+ name: Korean
59
+ population: 7_000_000
60
+ countries: 'South Korea'
61
+ greeting: '안녕하세요!'
62
+ 'tr':
63
+ abbreviation: 'tr'
64
+ name: Turkish
65
+ population: 14_000_000
66
+ countries: 'Turkey'
67
+ greeting: 'merhaba!'
68
+ 'ru':
69
+ abbreviation: 'ru'
70
+ name: Russian
71
+ population: 5_000_000
72
+ countries: 'Russia, Belarus, Kazakhstan, Kyrgyzstan'
73
+ greeting: 'привет!'
74
+ 'nl':
75
+ abbreviation: 'nl'
76
+ name: Dutch
77
+ population: 8_000_000
78
+ countries: 'Netherlands, Belgium'
79
+ greeting: 'hallo!'
80
+ 'fil':
81
+ abbreviation: 'fil'
82
+ name: Tagalog
83
+ countries: 'Philippines'
84
+ greeting: 'mabuhay!'
85
+ population: 8_000_000
86
+ 'ms':
87
+ abbreviation: 'ms'
88
+ name: Malay
89
+ population: 50_000_000
90
+ countries: 'Malaysia, Singapore, Brunei'
91
+ greeting: 'hello!'
92
+ 'zh':
93
+ abbreviation: 'zh'
94
+ name: Chinese
95
+ population: 20_000
96
+ countries: 'China, Hong-Kong, Macau'
97
+ greeting: '你好!'
98
+ 'hi':
99
+ abbreviation: 'hi'
100
+ name: Hindi
101
+ population: 12_000_000
102
+ countries: 'India, Pakistan, Fiji'
103
+ greeting: 'नमस्ते!'
104
+ 'no':
105
+ abbreviation: 'no'
106
+ name: Norwegian
107
+ population: 300_000
108
+ countries: 'goddag'
109
+ greeting: 'hello!'
110
+ 'sv':
111
+ abbreviation: 'sv'
112
+ name: Swedish
113
+ population: 500_000
114
+ countries: 'Sweden'
115
+ greeting: 'god dag!'
116
+ 'fi':
117
+ abbreviation: 'fi'
118
+ name: Finnish
119
+ population: 100_000
120
+ countries: 'Finnish'
121
+ greeting: ' terve!'
122
+ 'da':
123
+ abbreviation: 'da'
124
+ name: Danish
125
+ population: 200_000
126
+ countries: 'Danish'
127
+ greeting: 'hej!'
128
+ 'pl':
129
+ abbreviation: 'pl'
130
+ name: Polish
131
+ population: 300_000
132
+ countries: 'Poland'
133
+ greeting: 'cześć!'
134
+ 'hu':
135
+ abbreviation: 'hu'
136
+ name: Hungarian
137
+ population: 1_000_000
138
+ countries: 'Hungary'
139
+ greeting: ' jó napot kívánok!'
140
+ 'fa':
141
+ abbreviation: 'fa'
142
+ name: Farsi
143
+ population: 1_000_000
144
+ countries: 'Iran, Afghanistan, Tajikistan'
145
+ greeting: ' سلام!'
146
+ 'he':
147
+ abbreviation: 'he'
148
+ name: Hebrew
149
+ population: 1_000_000
150
+ countries: 'Israel'
151
+ greeting: 'שלום!'
152
+ 'ur':
153
+ abbreviation: 'ur'
154
+ name: Urdu
155
+ population: 1_000_000
156
+ countries: 'India, Pakistan, Fiji'
157
+ greeting: 'لسلام علیکم!'
158
+ 'th':
159
+ abbreviation: 'th'
160
+ name: Thai
161
+ population: 7_0000_000
162
+ countries: 'Thailand'
163
+ greeting: 'วัสดี!'
164
+ 'uk':
165
+ abbreviation: 'uk'
166
+ name: Ukranian
167
+ population: 1_0000_000
168
+ countries: 'Ukraine'
169
+ greeting: 'вітаю!'
170
+ 'el':
171
+ abbreviation: 'el'
172
+ name: Greek
173
+ population: 1_0000_000
174
+ countries: 'Greece, Cyprus'
175
+ greeting: 'γειά!'
176
+ 'cs':
177
+ abbreviation: 'cs'
178
+ name: Czech
179
+ population: 1_0000_000
180
+ countries: 'Czech Republic'
181
+ greeting: ' ahoj!'
182
+ 'ro':
183
+ abbreviation: 'ro'
184
+ name: Romanian
185
+ population: 1_0000_000
186
+ countries: 'Romania, Serbia, Moldova'
187
+ greeting: 'salut!'
@@ -2,19 +2,19 @@ require 'spec_helper'
2
2
 
3
3
  describe AlohaAnalyzer::Language do
4
4
  describe '.all' do
5
- it 'returns an array' do
6
- described_class.all.should be_a Array
5
+ it 'returns a Hash' do
6
+ described_class.all.should be_a Hash
7
7
  end
8
8
 
9
9
  it 'is not empty' do
10
- described_class.all.should be_a Array
10
+ described_class.all.should_not be_empty
11
11
  end
12
12
  end
13
13
 
14
14
  describe '.total' do
15
15
  it 'returns the total number of language users' do
16
16
  total = 0
17
- described_class.all.each do |language|
17
+ described_class.all.each do |abbreviation, language|
18
18
  total += language['population']
19
19
  end
20
20
  total.should eq described_class.total
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'rubygems'
2
- require 'debugger'
2
+ require 'byebug'
3
3
  require 'bundler/setup'
4
4
 
5
5
  require 'aloha_analyzer'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aloha_analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu Aussaguel
@@ -10,6 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2014-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: twitter_cldr
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -53,19 +67,19 @@ dependencies:
53
67
  - !ruby/object:Gem::Version
54
68
  version: '2.14'
55
69
  - !ruby/object:Gem::Dependency
56
- name: debugger
70
+ name: byebug
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '1.6'
75
+ version: '3.1'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: '1.6'
82
+ version: '3.1'
69
83
  description: Analyze twitter followers languages
70
84
  email:
71
85
  - matthieu.aussaguel@gmail.com
@@ -85,7 +99,8 @@ files:
85
99
  - lib/aloha_analyzer/language.rb
86
100
  - lib/aloha_analyzer/user.rb
87
101
  - lib/aloha_analyzer/version.rb
88
- - lib/aloha_analyzer/yaml/language.yml
102
+ - lib/aloha_analyzer/yaml/aliases.yml
103
+ - lib/aloha_analyzer/yaml/languages.yml
89
104
  - spec/aloha_analyzer/language_spec.rb
90
105
  - spec/aloha_analyzer/user_spec.rb
91
106
  - spec/aloha_analyzer_spec.rb
@@ -1,155 +0,0 @@
1
- - abbreviation: fr
2
- name: French
3
- population: 14_000_000
4
- countries: 'France, Canada, Belgium, Switzerland'
5
- greeting: 'bonjour!'
6
- - abbreviation: en
7
- name: English
8
- population: 238_000_000
9
- countries: 'USA, UK, Canada, Ireland, Australia'
10
- greeting: 'hello!'
11
- - abbreviation: ar
12
- name: Arabic
13
- population: 42_000_000
14
- countries: 'Egypt, Tunisia, Lebanon, United Arab Emirates'
15
- greeting: 'مرحبا!'
16
- - abbreviation: ja
17
- name: Japanese
18
- population: 106_580_000
19
- countries: 'Japan, Brazil'
20
- greeting: '今日は!'
21
- - abbreviation: es
22
- name: Spanish
23
- population: 95_000_000
24
- countries: 'Spain, Mexico, Argentina, Chile'
25
- greeting: '¡hola!'
26
- - abbreviation: de
27
- name: German
28
- population: 5_000_000
29
- countries: 'Germany, Austria, Switzerland, Belgium'
30
- greeting: 'hallo!'
31
- - abbreviation: it
32
- name: Italian
33
- population: 8_000_000
34
- countries: 'Italy, Switzerland, Malta'
35
- greeting: 'ciao!'
36
- - abbreviation: id
37
- name: Indonesian
38
- population: 20_000_000
39
- countries: 'Indonesia'
40
- greeting: 'halo!'
41
- - abbreviation: pt
42
- name: Portuguese
43
- population: 42_000_000
44
- countries: 'Portugal, Brazil, Macau'
45
- greeting: 'olá!'
46
- - abbreviation: ko
47
- name: Korean
48
- population: 7_000_000
49
- countries: 'South Korea'
50
- greeting: '안녕하세요!'
51
- - abbreviation: tr
52
- name: Turkish
53
- population: 14_000_000
54
- countries: 'Turkey'
55
- greeting: 'merhaba!'
56
- - abbreviation: ru
57
- name: Russian
58
- population: 5_000_000
59
- countries: 'Russia, Belarus, Kazakhstan, Kyrgyzstan'
60
- greeting: 'привет!'
61
- - abbreviation: nl
62
- name: Dutch
63
- population: 8_000_000
64
- countries: 'Netherlands, Belgium'
65
- greeting: 'hallo!'
66
- - abbreviation: fil
67
- name: Tagalog
68
- countries: 'Philippines'
69
- greeting: 'mabuhay!'
70
- population: 8_000_000
71
- - abbreviation: msa
72
- name: Malay
73
- population: 50_000_000
74
- countries: 'Malaysia, Singapore, Brunei'
75
- greeting: 'hello!'
76
- - abbreviation: zh
77
- name: Chinese
78
- population: 20_000
79
- countries: 'China, Hong-Kong, Macau'
80
- greeting: '你好!'
81
- - abbreviation: hi
82
- name: Hindi
83
- population: 12_000_000
84
- countries: 'India, Pakistan, Fiji'
85
- greeting: 'नमस्ते!'
86
- - abbreviation: 'no'
87
- name: Norwegian
88
- population: 300_000
89
- countries: 'goddag'
90
- greeting: 'hello!'
91
- - abbreviation: sv
92
- name: Swedish
93
- population: 500_000
94
- countries: 'Sweden'
95
- greeting: 'god dag!'
96
- - abbreviation: fi
97
- name: Finnish
98
- population: 100_000
99
- countries: 'Finnish'
100
- greeting: ' terve!'
101
- - abbreviation: da
102
- name: Danish
103
- population: 200_000
104
- countries: 'Danish'
105
- greeting: 'hej!'
106
- - abbreviation: pl
107
- name: Polish
108
- population: 300_000
109
- countries: 'Poland'
110
- greeting: 'cześć!'
111
- - abbreviation: hu
112
- name: Hungarian
113
- population: 1_000_000
114
- countries: 'Hungary'
115
- greeting: ' jó napot kívánok!'
116
- - abbreviation: fa
117
- name: Farsi
118
- population: 1_000_000
119
- countries: 'Iran, Afghanistan, Tajikistan'
120
- greeting: ' سلام!'
121
- - abbreviation: he
122
- name: Hebrew
123
- population: 1_000_000
124
- countries: 'Israel'
125
- greeting: 'שלום!'
126
- - abbreviation: ur
127
- name: Urdu
128
- population: 1_000_000
129
- countries: 'India, Pakistan, Fiji'
130
- greeting: 'لسلام علیکم!'
131
- - abbreviation: th
132
- name: Thai
133
- population: 7_0000_000
134
- countries: 'Thailand'
135
- greeting: 'วัสดี!'
136
- - abbreviation: uk
137
- name: Ukranian
138
- population: 1_0000_000
139
- countries: 'Ukraine'
140
- greeting: 'вітаю!'
141
- - abbreviation: el
142
- name: Greek
143
- population: 1_0000_000
144
- countries: 'Greece, Cyprus'
145
- greeting: 'γειά!'
146
- - abbreviation: cs
147
- name: Czech
148
- population: 1_0000_000
149
- countries: 'Czech Republic'
150
- greeting: ' ahoj!'
151
- - abbreviation: ro
152
- name: Romanian
153
- population: 1_0000_000
154
- countries: 'Romania, Serbia, Moldova'
155
- greeting: 'salut!'