twitter_cldr 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (308) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -2
  3. data/README.md +18 -2
  4. data/Rakefile +39 -122
  5. data/lib/twitter_cldr.rb +3 -0
  6. data/lib/twitter_cldr/formatters/numbers/rbnf.rb +5 -1
  7. data/lib/twitter_cldr/resources.rb +86 -5
  8. data/lib/twitter_cldr/resources/bidi_test_importer.rb +50 -44
  9. data/lib/twitter_cldr/resources/casefolder_class_generator.rb +22 -13
  10. data/lib/twitter_cldr/resources/collation_tries_importer.rb +44 -0
  11. data/lib/twitter_cldr/resources/hyphenation_importer.rb +16 -42
  12. data/lib/twitter_cldr/resources/import_resolver.rb +71 -0
  13. data/lib/twitter_cldr/resources/importer.rb +107 -0
  14. data/lib/twitter_cldr/resources/language_codes_importer.rb +35 -38
  15. data/lib/twitter_cldr/resources/loader.rb +3 -3
  16. data/lib/twitter_cldr/resources/locales_resources_importer.rb +48 -35
  17. data/lib/twitter_cldr/resources/phone_codes_importer.rb +24 -23
  18. data/lib/twitter_cldr/resources/postal_codes_importer.rb +10 -11
  19. data/lib/twitter_cldr/resources/properties.rb +0 -4
  20. data/lib/twitter_cldr/resources/properties/age_property_importer.rb +13 -9
  21. data/lib/twitter_cldr/resources/properties/arabic_shaping_property_importer.rb +9 -11
  22. data/lib/twitter_cldr/resources/properties/bidi_brackets_property_importer.rb +11 -9
  23. data/lib/twitter_cldr/resources/properties/blocks_property_importer.rb +13 -9
  24. data/lib/twitter_cldr/resources/properties/derived_core_properties_importer.rb +9 -11
  25. data/lib/twitter_cldr/resources/properties/east_asian_width_property_importer.rb +13 -9
  26. data/lib/twitter_cldr/resources/properties/grapheme_break_property_importer.rb +13 -9
  27. data/lib/twitter_cldr/resources/properties/hangul_syllable_type_property_importer.rb +13 -9
  28. data/lib/twitter_cldr/resources/properties/indic_positional_category_property_importer.rb +13 -9
  29. data/lib/twitter_cldr/resources/properties/indic_syllabic_category_property_importer.rb +13 -9
  30. data/lib/twitter_cldr/resources/properties/jamo_property_importer.rb +13 -9
  31. data/lib/twitter_cldr/resources/properties/line_break_property_importer.rb +13 -9
  32. data/lib/twitter_cldr/resources/properties/prop_list_importer.rb +9 -11
  33. data/lib/twitter_cldr/resources/properties/property_importer.rb +13 -22
  34. data/lib/twitter_cldr/resources/properties/script_extensions_property_importer.rb +12 -10
  35. data/lib/twitter_cldr/resources/properties/script_property_importer.rb +13 -9
  36. data/lib/twitter_cldr/resources/properties/sentence_break_property_importer.rb +13 -9
  37. data/lib/twitter_cldr/resources/properties/unicode_data_properties_importer.rb +11 -9
  38. data/lib/twitter_cldr/resources/properties/word_break_property_importer.rb +13 -9
  39. data/lib/twitter_cldr/resources/rbnf_test_importer.rb +41 -38
  40. data/lib/twitter_cldr/resources/readme_renderer.rb +1 -2
  41. data/lib/twitter_cldr/resources/requirements.rb +18 -0
  42. data/lib/twitter_cldr/resources/requirements/cldr_requirement.rb +66 -0
  43. data/lib/twitter_cldr/resources/requirements/dependency_requirement.rb +23 -0
  44. data/lib/twitter_cldr/resources/requirements/git_requirement.rb +66 -0
  45. data/lib/twitter_cldr/resources/requirements/icu_requirement.rb +111 -0
  46. data/lib/twitter_cldr/resources/requirements/unicode_requirement.rb +51 -0
  47. data/lib/twitter_cldr/resources/segment_tests_importer.rb +15 -30
  48. data/lib/twitter_cldr/resources/tailoring_importer.rb +33 -26
  49. data/lib/twitter_cldr/resources/transform_test_importer.rb +15 -17
  50. data/lib/twitter_cldr/resources/uli/segment_exceptions_importer.rb +29 -17
  51. data/lib/twitter_cldr/resources/unicode_data_importer.rb +38 -31
  52. data/lib/twitter_cldr/resources/unicode_file_parser.rb +37 -0
  53. data/lib/twitter_cldr/resources/unicode_property_aliases_importer.rb +23 -27
  54. data/lib/twitter_cldr/shared/casefolder.rb +139 -115
  55. data/lib/twitter_cldr/version.rb +1 -1
  56. data/lib/twitter_cldr/versions.rb +0 -4
  57. data/resources/collation/tailoring/bo.yml +4 -0
  58. data/resources/collation/tries/bo.dump +0 -0
  59. data/resources/locales/bo/calendars.yml +247 -0
  60. data/resources/locales/bo/currencies.yml +208 -0
  61. data/resources/locales/bo/fields.yml +31 -0
  62. data/resources/locales/bo/languages.yml +24 -0
  63. data/resources/locales/bo/layout.yml +5 -0
  64. data/resources/locales/bo/lists.yml +12 -0
  65. data/resources/locales/bo/numbers.yml +111 -0
  66. data/resources/locales/bo/plural_rules.yml +6 -0
  67. data/resources/locales/bo/plurals.yml +12 -0
  68. data/resources/locales/bo/territories.yml +14 -0
  69. data/resources/locales/bo/units.yml +283 -0
  70. data/resources/shared/transforms/Arab-Latn.yml +109 -0
  71. data/resources/shared/transforms/Beng-Deva.yml +13 -0
  72. data/resources/shared/transforms/Beng-Gujr.yml +13 -0
  73. data/resources/shared/transforms/Beng-Guru.yml +13 -0
  74. data/resources/shared/transforms/Beng-Knda.yml +13 -0
  75. data/resources/shared/transforms/Beng-Latn.yml +13 -0
  76. data/resources/shared/transforms/Beng-Mlym.yml +13 -0
  77. data/resources/shared/transforms/Beng-Orya.yml +13 -0
  78. data/resources/shared/transforms/Beng-Taml.yml +13 -0
  79. data/resources/shared/transforms/Beng-Telu.yml +13 -0
  80. data/resources/shared/transforms/Cyrl-Latn.yml +128 -0
  81. data/resources/shared/transforms/Deva-Beng.yml +13 -0
  82. data/resources/shared/transforms/Deva-Gujr.yml +13 -0
  83. data/resources/shared/transforms/Deva-Guru.yml +13 -0
  84. data/resources/shared/transforms/Deva-Knda.yml +13 -0
  85. data/resources/shared/transforms/Deva-Latn.yml +13 -0
  86. data/resources/shared/transforms/Deva-Mlym.yml +13 -0
  87. data/resources/shared/transforms/Deva-Orya.yml +13 -0
  88. data/resources/shared/transforms/Deva-Taml.yml +13 -0
  89. data/resources/shared/transforms/Deva-Telu.yml +13 -0
  90. data/resources/shared/transforms/Geor-Latn.yml +43 -0
  91. data/resources/shared/transforms/Grek-Latn-UNGEGN.yml +160 -0
  92. data/resources/shared/transforms/Grek-Latn.yml +206 -0
  93. data/resources/shared/transforms/Gujr-Beng.yml +13 -0
  94. data/resources/shared/transforms/Gujr-Deva.yml +13 -0
  95. data/resources/shared/transforms/Gujr-Guru.yml +13 -0
  96. data/resources/shared/transforms/Gujr-Knda.yml +13 -0
  97. data/resources/shared/transforms/Gujr-Latn.yml +13 -0
  98. data/resources/shared/transforms/Gujr-Mlym.yml +13 -0
  99. data/resources/shared/transforms/Gujr-Orya.yml +13 -0
  100. data/resources/shared/transforms/Gujr-Taml.yml +13 -0
  101. data/resources/shared/transforms/Gujr-Telu.yml +13 -0
  102. data/resources/shared/transforms/Guru-Beng.yml +13 -0
  103. data/resources/shared/transforms/Guru-Deva.yml +13 -0
  104. data/resources/shared/transforms/Guru-Gujr.yml +13 -0
  105. data/resources/shared/transforms/Guru-Knda.yml +13 -0
  106. data/resources/shared/transforms/Guru-Latn.yml +13 -0
  107. data/resources/shared/transforms/Guru-Mlym.yml +13 -0
  108. data/resources/shared/transforms/Guru-Orya.yml +13 -0
  109. data/resources/shared/transforms/Guru-Taml.yml +13 -0
  110. data/resources/shared/transforms/Guru-Telu.yml +13 -0
  111. data/resources/shared/transforms/Han-Spacedhan.yml +1 -1
  112. data/resources/shared/transforms/Hang-Latn.yml +12 -0
  113. data/resources/shared/transforms/Hani-Latn.yml +1605 -0
  114. data/resources/shared/transforms/Hans-Hant.yml +3982 -0
  115. data/resources/shared/transforms/Hebr-Latn.yml +72 -0
  116. data/resources/shared/transforms/Hira-Kana.yml +114 -0
  117. data/resources/shared/transforms/Hira-Latn.yml +15 -0
  118. data/resources/shared/transforms/InterIndic-Latin.yml +2 -2
  119. data/resources/shared/transforms/Jamo-Latn.yml +12 -0
  120. data/resources/shared/transforms/Knda-Beng.yml +13 -0
  121. data/resources/shared/transforms/Knda-Deva.yml +13 -0
  122. data/resources/shared/transforms/Knda-Gujr.yml +13 -0
  123. data/resources/shared/transforms/Knda-Guru.yml +13 -0
  124. data/resources/shared/transforms/Knda-Latn.yml +13 -0
  125. data/resources/shared/transforms/Knda-Mlym.yml +13 -0
  126. data/resources/shared/transforms/Knda-Orya.yml +13 -0
  127. data/resources/shared/transforms/Knda-Taml.yml +13 -0
  128. data/resources/shared/transforms/Knda-Telu.yml +13 -0
  129. data/resources/shared/transforms/Latin-ASCII.yml +16 -1
  130. data/resources/shared/transforms/Latin-InterIndic.yml +2 -2
  131. data/resources/shared/transforms/Latn-Armn.yml +90 -0
  132. data/resources/shared/transforms/Latn-Beng.yml +14 -0
  133. data/resources/shared/transforms/Latn-Bopo.yml +1336 -0
  134. data/resources/shared/transforms/Latn-Cans.yml +190 -0
  135. data/resources/shared/transforms/Latn-Deva.yml +14 -0
  136. data/resources/shared/transforms/Latn-Ethi.yml +278 -0
  137. data/resources/shared/transforms/Latn-Gujr.yml +14 -0
  138. data/resources/shared/transforms/Latn-Guru.yml +14 -0
  139. data/resources/shared/transforms/Latn-Hang.yml +13 -0
  140. data/resources/shared/transforms/Latn-Jamo.yml +13 -0
  141. data/resources/shared/transforms/Latn-Kana.yml +274 -0
  142. data/resources/shared/transforms/Latn-Knda.yml +14 -0
  143. data/resources/shared/transforms/Latn-Mlym.yml +14 -0
  144. data/resources/shared/transforms/Latn-Orya.yml +14 -0
  145. data/resources/shared/transforms/Latn-Taml.yml +14 -0
  146. data/resources/shared/transforms/Latn-Telu.yml +14 -0
  147. data/resources/shared/transforms/Latn-Thaa.yml +439 -0
  148. data/resources/shared/transforms/Latn-Thai.yml +13 -0
  149. data/resources/shared/transforms/Mlym-Beng.yml +13 -0
  150. data/resources/shared/transforms/Mlym-Deva.yml +13 -0
  151. data/resources/shared/transforms/Mlym-Gujr.yml +13 -0
  152. data/resources/shared/transforms/Mlym-Guru.yml +13 -0
  153. data/resources/shared/transforms/Mlym-Knda.yml +13 -0
  154. data/resources/shared/transforms/Mlym-Latn.yml +13 -0
  155. data/resources/shared/transforms/Mlym-Orya.yml +13 -0
  156. data/resources/shared/transforms/Mlym-Taml.yml +13 -0
  157. data/resources/shared/transforms/Mlym-Telu.yml +13 -0
  158. data/resources/shared/transforms/Orya-Beng.yml +13 -0
  159. data/resources/shared/transforms/Orya-Deva.yml +13 -0
  160. data/resources/shared/transforms/Orya-Gujr.yml +13 -0
  161. data/resources/shared/transforms/Orya-Guru.yml +13 -0
  162. data/resources/shared/transforms/Orya-Knda.yml +13 -0
  163. data/resources/shared/transforms/Orya-Latn.yml +13 -0
  164. data/resources/shared/transforms/Orya-Mlym.yml +13 -0
  165. data/resources/shared/transforms/Orya-Taml.yml +13 -0
  166. data/resources/shared/transforms/Orya-Telu.yml +13 -0
  167. data/resources/shared/transforms/Syrc-Latn.yml +55 -0
  168. data/resources/shared/transforms/Taml-Beng.yml +13 -0
  169. data/resources/shared/transforms/Taml-Deva.yml +13 -0
  170. data/resources/shared/transforms/Taml-Gujr.yml +13 -0
  171. data/resources/shared/transforms/Taml-Guru.yml +13 -0
  172. data/resources/shared/transforms/Taml-Knda.yml +13 -0
  173. data/resources/shared/transforms/Taml-Latn.yml +13 -0
  174. data/resources/shared/transforms/Taml-Mlym.yml +13 -0
  175. data/resources/shared/transforms/Taml-Orya.yml +13 -0
  176. data/resources/shared/transforms/Taml-Telu.yml +13 -0
  177. data/resources/shared/transforms/Telu-Beng.yml +13 -0
  178. data/resources/shared/transforms/Telu-Deva.yml +13 -0
  179. data/resources/shared/transforms/Telu-Gujr.yml +13 -0
  180. data/resources/shared/transforms/Telu-Guru.yml +13 -0
  181. data/resources/shared/transforms/Telu-Knda.yml +13 -0
  182. data/resources/shared/transforms/Telu-Latn.yml +13 -0
  183. data/resources/shared/transforms/Telu-Mlym.yml +13 -0
  184. data/resources/shared/transforms/Telu-Orya.yml +13 -0
  185. data/resources/shared/transforms/Telu-Taml.yml +13 -0
  186. data/resources/shared/transforms/Thai-Latn.yml +15 -0
  187. data/resources/shared/transforms/am-am_FONIPA.yml +609 -0
  188. data/resources/shared/transforms/am-am_Latn-BGN.yml +336 -0
  189. data/resources/shared/transforms/am-ar.yml +11 -0
  190. data/resources/shared/transforms/am-fa.yml +10 -0
  191. data/resources/shared/transforms/ar-ar_Latn-BGN.yml +122 -0
  192. data/resources/shared/transforms/az_Cyrl-az-BGN.yml +93 -0
  193. data/resources/shared/transforms/be-be_Latn-BGN.yml +108 -0
  194. data/resources/shared/transforms/bg-bg_Latn-BGN.yml +99 -0
  195. data/resources/shared/transforms/ch-am.yml +10 -0
  196. data/resources/shared/transforms/ch-ar.yml +10 -0
  197. data/resources/shared/transforms/ch-ch_FONIPA.yml +0 -8
  198. data/resources/shared/transforms/ch-fa.yml +10 -0
  199. data/resources/shared/transforms/cs-am.yml +10 -0
  200. data/resources/shared/transforms/cs-ar.yml +10 -0
  201. data/resources/shared/transforms/cs-fa.yml +10 -0
  202. data/resources/shared/transforms/dsb-dsb_FONIPA.yml +0 -5
  203. data/resources/shared/transforms/dv-dv_Latn-BGN.yml +112 -0
  204. data/resources/shared/transforms/el-el_Latn-BGN.yml +208 -0
  205. data/resources/shared/transforms/eo-am.yml +10 -0
  206. data/resources/shared/transforms/eo-ar.yml +10 -0
  207. data/resources/shared/transforms/eo-eo_FONIPA.yml +52 -0
  208. data/resources/shared/transforms/eo-fa.yml +10 -0
  209. data/resources/shared/transforms/es-ar.yml +13 -0
  210. data/resources/shared/transforms/es-fa.yml +13 -0
  211. data/resources/shared/transforms/es_419-am.yml +11 -0
  212. data/resources/shared/transforms/es_419-ar.yml +14 -0
  213. data/resources/shared/transforms/es_419-fa.yml +14 -0
  214. data/resources/shared/transforms/fa-fa_Latn-BGN.yml +123 -0
  215. data/resources/shared/transforms/he-he_Latn-BGN.yml +62 -0
  216. data/resources/shared/transforms/hy-am.yml +10 -0
  217. data/resources/shared/transforms/hy-ar.yml +10 -0
  218. data/resources/shared/transforms/hy-fa.yml +10 -0
  219. data/resources/shared/transforms/hy-hy_FONIPA.yml +56 -0
  220. data/resources/shared/transforms/hy-hy_Latn-BGN.yml +133 -0
  221. data/resources/shared/transforms/hy_AREVMDA-am.yml +10 -0
  222. data/resources/shared/transforms/hy_AREVMDA-ar.yml +10 -0
  223. data/resources/shared/transforms/hy_AREVMDA-fa.yml +10 -0
  224. data/resources/shared/transforms/hy_AREVMDA-hy_AREVMDA_FONIPA.yml +82 -0
  225. data/resources/shared/transforms/ia-am.yml +10 -0
  226. data/resources/shared/transforms/ia-ar.yml +10 -0
  227. data/resources/shared/transforms/ia-fa.yml +10 -0
  228. data/resources/shared/transforms/ia-ia_FONIPA.yml +69 -0
  229. data/resources/shared/transforms/ja_Hrkt-ja_Latn-BGN.yml +310 -0
  230. data/resources/shared/transforms/ka-ka_Latn-BGN.yml +44 -0
  231. data/resources/shared/transforms/kk-am.yml +10 -0
  232. data/resources/shared/transforms/kk-ar.yml +10 -0
  233. data/resources/shared/transforms/kk-fa.yml +10 -0
  234. data/resources/shared/transforms/kk-kk_FONIPA.yml +53 -0
  235. data/resources/shared/transforms/kk-kk_Latn-BGN.yml +136 -0
  236. data/resources/shared/transforms/ko-ko_Latn-BGN.yml +282 -0
  237. data/resources/shared/transforms/ky-am.yml +10 -0
  238. data/resources/shared/transforms/ky-ar.yml +10 -0
  239. data/resources/shared/transforms/ky-fa.yml +10 -0
  240. data/resources/shared/transforms/ky-ky_FONIPA.yml +73 -0
  241. data/resources/shared/transforms/ky-ky_Latn-BGN.yml +107 -0
  242. data/resources/shared/transforms/la-la_FONIPA.yml +0 -8
  243. data/resources/shared/transforms/mk-mk_Latn-BGN.yml +89 -0
  244. data/resources/shared/transforms/mn-mn_Latn-BGN.yml +101 -0
  245. data/resources/shared/transforms/mn-mn_Latn-MNS.yml +89 -0
  246. data/resources/shared/transforms/my-am.yml +10 -0
  247. data/resources/shared/transforms/my-ar.yml +10 -0
  248. data/resources/shared/transforms/my-fa.yml +10 -0
  249. data/resources/shared/transforms/my-my_FONIPA.yml +260 -0
  250. data/resources/shared/transforms/pl-am.yml +10 -0
  251. data/resources/shared/transforms/pl-ar.yml +10 -0
  252. data/resources/shared/transforms/pl-fa.yml +10 -0
  253. data/resources/shared/transforms/ps-ps_Latn-BGN.yml +151 -0
  254. data/resources/shared/transforms/rm_SURSILV-am.yml +10 -0
  255. data/resources/shared/transforms/rm_SURSILV-ar.yml +10 -0
  256. data/resources/shared/transforms/rm_SURSILV-fa.yml +10 -0
  257. data/resources/shared/transforms/rm_SURSILV-rm_FONIPA_SURSILV.yml +84 -0
  258. data/resources/shared/transforms/ro-am.yml +10 -0
  259. data/resources/shared/transforms/ro-ar.yml +10 -0
  260. data/resources/shared/transforms/ro-fa.yml +10 -0
  261. data/resources/shared/transforms/ro-ro_FONIPA.yml +38 -6
  262. data/resources/shared/transforms/ro_FONIPA-ja.yml +1 -0
  263. data/resources/shared/transforms/ru-ru_Latn-BGN.yml +121 -0
  264. data/resources/shared/transforms/ru_Latn-ru-BGN.yml +101 -0
  265. data/resources/shared/transforms/sat-am.yml +10 -0
  266. data/resources/shared/transforms/sat-ar.yml +10 -0
  267. data/resources/shared/transforms/sat-fa.yml +10 -0
  268. data/resources/shared/transforms/sat_Olck-sat_FONIPA.yml +132 -0
  269. data/resources/shared/transforms/si-am.yml +10 -0
  270. data/resources/shared/transforms/si-ar.yml +10 -0
  271. data/resources/shared/transforms/si-fa.yml +10 -0
  272. data/resources/shared/transforms/si-si_FONIPA.yml +128 -0
  273. data/resources/shared/transforms/si-si_Latn.yml +96 -0
  274. data/resources/shared/transforms/sk-am.yml +10 -0
  275. data/resources/shared/transforms/sk-ar.yml +10 -0
  276. data/resources/shared/transforms/sk-fa.yml +10 -0
  277. data/resources/shared/transforms/sk-sk_FONIPA.yml +18 -2
  278. data/resources/shared/transforms/sk_FONIPA-ja.yml +2 -0
  279. data/resources/shared/transforms/sr-sr_Latn-BGN.yml +81 -0
  280. data/resources/shared/transforms/tk_Cyrl-tk-BGN.yml +122 -0
  281. data/resources/shared/transforms/tlh-am.yml +10 -0
  282. data/resources/shared/transforms/tlh-ar.yml +10 -0
  283. data/resources/shared/transforms/tlh-fa.yml +10 -0
  284. data/resources/shared/transforms/tlh-tlh_FONIPA.yml +0 -8
  285. data/resources/shared/transforms/uk-uk_Latn-BGN.yml +115 -0
  286. data/resources/shared/transforms/und_FONIPA-ar.yml +96 -0
  287. data/resources/shared/transforms/und_FONIPA-fa.yml +88 -0
  288. data/resources/shared/transforms/und_FONIPA-und_FONXSAMP.yml +198 -0
  289. data/resources/shared/transforms/uz_Cyrl-uz-BGN.yml +117 -0
  290. data/resources/shared/transforms/xh-am.yml +10 -0
  291. data/resources/shared/transforms/xh-ar.yml +10 -0
  292. data/resources/shared/transforms/xh-fa.yml +10 -0
  293. data/resources/shared/transforms/xh-xh_FONIPA.yml +71 -0
  294. data/resources/shared/transforms/zu-am.yml +10 -0
  295. data/resources/shared/transforms/zu-ar.yml +10 -0
  296. data/resources/shared/transforms/zu-fa.yml +10 -0
  297. data/resources/shared/transforms/zu-zu_FONIPA.yml +58 -0
  298. data/spec/formatters/numbers/rbnf/rbnf_spec.rb +3 -1
  299. data/spec/resources/loader_spec.rb +12 -5
  300. data/spec/spec_helper.rb +1 -1
  301. metadata +242 -10
  302. data/History.txt +0 -282
  303. data/lib/twitter_cldr/resources/collation_tries_dumper.rb +0 -43
  304. data/lib/twitter_cldr/resources/custom_locales_resources_importer.rb +0 -80
  305. data/lib/twitter_cldr/resources/download.rb +0 -64
  306. data/lib/twitter_cldr/resources/icu_based_importer.rb +0 -18
  307. data/lib/twitter_cldr/resources/properties/properties_importer.rb +0 -59
  308. data/lib/twitter_cldr/resources/unicode_importer.rb +0 -37
@@ -8,17 +8,21 @@ module TwitterCldr
8
8
  module Properties
9
9
 
10
10
  class GraphemeBreakPropertyImporter < PropertyImporter
11
- DATA_URL = 'ucd/auxiliary/GraphemeBreakProperty.txt'
11
+ DATA_FILE = 'ucd/auxiliary/GraphemeBreakProperty.txt'
12
12
  PROPERTY_NAME = 'Grapheme_Cluster_Break'
13
13
 
14
- def initialize(input_path, database)
15
- super(
16
- input_path: input_path,
17
- property_name: PROPERTY_NAME,
18
- data_url: DATA_URL,
19
- data_path: File.basename(DATA_URL),
20
- database: database
21
- )
14
+ requirement :unicode, Versions.unicode_version, [DATA_FILE]
15
+ output_path 'unicode_data/properties'
16
+ ruby_engine :mri
17
+
18
+ def property_name
19
+ PROPERTY_NAME
20
+ end
21
+
22
+ private
23
+
24
+ def source_path
25
+ requirements[:unicode].source_path_for(DATA_FILE)
22
26
  end
23
27
  end
24
28
 
@@ -8,17 +8,21 @@ module TwitterCldr
8
8
  module Properties
9
9
 
10
10
  class HangulSyllableTypePropertyImporter < PropertyImporter
11
- DATA_URL = 'ucd/HangulSyllableType.txt'
11
+ DATA_FILE = 'ucd/HangulSyllableType.txt'
12
12
  PROPERTY_NAME = 'Hangul_Syllable_Type'
13
13
 
14
- def initialize(input_path, database)
15
- super(
16
- input_path: input_path,
17
- property_name: PROPERTY_NAME,
18
- data_url: DATA_URL,
19
- data_path: File.basename(DATA_URL),
20
- database: database
21
- )
14
+ requirement :unicode, Versions.unicode_version, [DATA_FILE]
15
+ output_path 'unicode_data/properties'
16
+ ruby_engine :mri
17
+
18
+ def property_name
19
+ PROPERTY_NAME
20
+ end
21
+
22
+ private
23
+
24
+ def source_path
25
+ requirements[:unicode].source_path_for(DATA_FILE)
22
26
  end
23
27
  end
24
28
 
@@ -8,17 +8,21 @@ module TwitterCldr
8
8
  module Properties
9
9
 
10
10
  class IndicPositionalCategoryPropertyImporter < PropertyImporter
11
- DATA_URL = 'ucd/IndicPositionalCategory.txt'
11
+ DATA_FILE = 'ucd/IndicPositionalCategory.txt'
12
12
  PROPERTY_NAME = 'Indic_Positional_Category'
13
13
 
14
- def initialize(input_path, database)
15
- super(
16
- input_path: input_path,
17
- property_name: PROPERTY_NAME,
18
- data_url: DATA_URL,
19
- data_path: File.basename(DATA_URL),
20
- database: database
21
- )
14
+ requirement :unicode, Versions.unicode_version, [DATA_FILE]
15
+ output_path 'unicode_data/properties'
16
+ ruby_engine :mri
17
+
18
+ def property_name
19
+ PROPERTY_NAME
20
+ end
21
+
22
+ private
23
+
24
+ def source_path
25
+ requirements[:unicode].source_path_for(DATA_FILE)
22
26
  end
23
27
  end
24
28
 
@@ -8,17 +8,21 @@ module TwitterCldr
8
8
  module Properties
9
9
 
10
10
  class IndicSyllabicCategoryPropertyImporter < PropertyImporter
11
- DATA_URL = 'ucd/IndicSyllabicCategory.txt'
11
+ DATA_FILE = 'ucd/IndicSyllabicCategory.txt'
12
12
  PROPERTY_NAME = 'Indic_Syllabic_Category'
13
13
 
14
- def initialize(input_path, database)
15
- super(
16
- input_path: input_path,
17
- property_name: PROPERTY_NAME,
18
- data_url: DATA_URL,
19
- data_path: File.basename(DATA_URL),
20
- database: database
21
- )
14
+ requirement :unicode, Versions.unicode_version, [DATA_FILE]
15
+ output_path 'unicode_data/properties'
16
+ ruby_engine :mri
17
+
18
+ def property_name
19
+ PROPERTY_NAME
20
+ end
21
+
22
+ private
23
+
24
+ def source_path
25
+ requirements[:unicode].source_path_for(DATA_FILE)
22
26
  end
23
27
  end
24
28
 
@@ -8,17 +8,21 @@ module TwitterCldr
8
8
  module Properties
9
9
 
10
10
  class JamoPropertyImporter < PropertyImporter
11
- DATA_URL = 'ucd/Jamo.txt'
11
+ DATA_FILE = 'ucd/Jamo.txt'
12
12
  PROPERTY_NAME = 'Jamo_Short_Name'
13
13
 
14
- def initialize(input_path, database)
15
- super(
16
- input_path: input_path,
17
- property_name: PROPERTY_NAME,
18
- data_url: DATA_URL,
19
- data_path: File.basename(DATA_URL),
20
- database: database
21
- )
14
+ requirement :unicode, Versions.unicode_version, [DATA_FILE]
15
+ output_path 'unicode_data/properties'
16
+ ruby_engine :mri
17
+
18
+ def property_name
19
+ PROPERTY_NAME
20
+ end
21
+
22
+ private
23
+
24
+ def source_path
25
+ requirements[:unicode].source_path_for(DATA_FILE)
22
26
  end
23
27
  end
24
28
 
@@ -8,17 +8,21 @@ module TwitterCldr
8
8
  module Properties
9
9
 
10
10
  class LineBreakPropertyImporter < PropertyImporter
11
- DATA_URL = 'ucd/LineBreak.txt'
11
+ DATA_FILE = 'ucd/LineBreak.txt'
12
12
  PROPERTY_NAME = 'Line_Break'
13
13
 
14
- def initialize(input_path, database)
15
- super(
16
- input_path: input_path,
17
- property_name: PROPERTY_NAME,
18
- data_url: DATA_URL,
19
- data_path: File.basename(DATA_URL),
20
- database: database
21
- )
14
+ requirement :unicode, Versions.unicode_version, [DATA_FILE]
15
+ output_path 'unicode_data/properties'
16
+ ruby_engine :mri
17
+
18
+ def property_name
19
+ PROPERTY_NAME
20
+ end
21
+
22
+ private
23
+
24
+ def source_path
25
+ requirements[:unicode].source_path_for(DATA_FILE)
22
26
  end
23
27
  end
24
28
 
@@ -8,20 +8,18 @@ module TwitterCldr
8
8
  module Properties
9
9
 
10
10
  class PropListImporter < PropertyImporter
11
- DATA_URL = 'ucd/PropList.txt'
12
-
13
- def initialize(input_path, database)
14
- super(
15
- input_path: input_path,
16
- property_name: nil,
17
- data_url: DATA_URL,
18
- data_path: File.basename(DATA_URL),
19
- database: database
20
- )
21
- end
11
+ DATA_FILE = 'ucd/PropList.txt'
12
+
13
+ requirement :unicode, Versions.unicode_version, [DATA_FILE]
14
+ output_path 'unicode_data/properties'
15
+ ruby_engine :mri
22
16
 
23
17
  private
24
18
 
19
+ def source_path
20
+ requirements[:unicode].source_path_for(DATA_FILE)
21
+ end
22
+
25
23
  def load
26
24
  super do |data, ret|
27
25
  code_points = expand_range(data[0])
@@ -3,25 +3,14 @@
3
3
  # Copyright 2012 Twitter, Inc
4
4
  # http://www.apache.org/licenses/LICENSE-2.0
5
5
 
6
- require 'twitter_cldr/resources/download'
7
-
8
6
  module TwitterCldr
9
7
  module Resources
10
8
  module Properties
11
9
 
12
- class PropertyImporter < UnicodeImporter
13
- attr_reader :input_path, :property_name
14
- attr_reader :data_url, :data_path, :database
15
-
16
- def initialize(options)
17
- @input_path = options.fetch(:input_path)
18
- @property_name = options.fetch(:property_name)
19
- @data_url = options.fetch(:data_url)
20
- @data_path = options.fetch(:data_path)
21
- @database = options.fetch(:database)
22
- end
10
+ class PropertyImporter < Importer
11
+ private
23
12
 
24
- def import
13
+ def execute
25
14
  load.each_pair do |property_name, property_values|
26
15
  property_values.each_pair do |property_value, ranges|
27
16
  database.store(property_name, property_value, ranges)
@@ -29,7 +18,15 @@ module TwitterCldr
29
18
  end
30
19
  end
31
20
 
32
- private
21
+ def database
22
+ @database ||= TwitterCldr::Shared::PropertiesDatabase.new(
23
+ params.fetch(:output_path)
24
+ )
25
+ end
26
+
27
+ def parse_file(file, &block)
28
+ UnicodeFileParser.parse_standard_file(file, &block)
29
+ end
33
30
 
34
31
  def load
35
32
  results = Hash.new do |h, k|
@@ -37,7 +34,7 @@ module TwitterCldr
37
34
  end
38
35
 
39
36
  rangify_hash(
40
- parse_standard_file(data_file).each_with_object(results) do |data, ret|
37
+ parse_file(source_path).each_with_object(results) do |data, ret|
41
38
  next unless data[0].size > 0
42
39
 
43
40
  if block_given?
@@ -70,12 +67,6 @@ module TwitterCldr
70
67
  def format_property_value(value)
71
68
  value
72
69
  end
73
-
74
- def data_file
75
- TwitterCldr::Resources.download_unicode_data_if_necessary(
76
- File.join(input_path, data_path), data_url
77
- )
78
- end
79
70
  end
80
71
 
81
72
  end
@@ -8,28 +8,30 @@ module TwitterCldr
8
8
  module Properties
9
9
 
10
10
  class ScriptExtensionsPropertyImporter < PropertyImporter
11
- DATA_URL = 'ucd/ScriptExtensions.txt'
11
+ DATA_FILE = 'ucd/ScriptExtensions.txt'
12
12
  PROPERTY_NAME = 'Script_Extensions'
13
13
 
14
- def initialize(input_path, database)
15
- super(
16
- input_path: input_path,
17
- property_name: PROPERTY_NAME,
18
- data_url: DATA_URL,
19
- data_path: File.basename(DATA_URL),
20
- database: database
21
- )
14
+ requirement :unicode, Versions.unicode_version, [DATA_FILE]
15
+ output_path 'unicode_data/properties'
16
+ ruby_engine :mri
17
+
18
+ def property_name
19
+ PROPERTY_NAME
22
20
  end
23
21
 
24
22
  private
25
23
 
24
+ def source_path
25
+ requirements[:unicode].source_path_for(DATA_FILE)
26
+ end
27
+
26
28
  def load
27
29
  super do |data, ret|
28
30
  code_points = expand_range(data[0])
29
31
  property_values = data[1].split(' ')
30
32
 
31
33
  property_values.each do |property_value|
32
- ret[PROPERTY_NAME][property_value] += code_points
34
+ ret[property_name][property_value] += code_points
33
35
  end
34
36
  end
35
37
  end
@@ -8,17 +8,21 @@ module TwitterCldr
8
8
  module Properties
9
9
 
10
10
  class ScriptPropertyImporter < PropertyImporter
11
- DATA_URL = 'ucd/Scripts.txt'
11
+ DATA_FILE = 'ucd/Scripts.txt'
12
12
  PROPERTY_NAME = 'Script'
13
13
 
14
- def initialize(input_path, database)
15
- super(
16
- input_path: input_path,
17
- property_name: PROPERTY_NAME,
18
- data_url: DATA_URL,
19
- data_path: File.basename(DATA_URL),
20
- database: database
21
- )
14
+ requirement :unicode, Versions.unicode_version, [DATA_FILE]
15
+ output_path 'unicode_data/properties'
16
+ ruby_engine :mri
17
+
18
+ def property_name
19
+ PROPERTY_NAME
20
+ end
21
+
22
+ private
23
+
24
+ def source_path
25
+ requirements[:unicode].source_path_for(DATA_FILE)
22
26
  end
23
27
  end
24
28
 
@@ -8,17 +8,21 @@ module TwitterCldr
8
8
  module Properties
9
9
 
10
10
  class SentenceBreakPropertyImporter < PropertyImporter
11
- DATA_URL = 'ucd/auxiliary/SentenceBreakProperty.txt'
11
+ DATA_FILE = 'ucd/auxiliary/SentenceBreakProperty.txt'
12
12
  PROPERTY_NAME = 'Sentence_Break'
13
13
 
14
- def initialize(input_path, database)
15
- super(
16
- input_path: input_path,
17
- property_name: PROPERTY_NAME,
18
- data_url: DATA_URL,
19
- data_path: File.basename(DATA_URL),
20
- database: database
21
- )
14
+ requirement :unicode, Versions.unicode_version, [DATA_FILE]
15
+ output_path 'unicode_data/properties'
16
+ ruby_engine :mri
17
+
18
+ def property_name
19
+ PROPERTY_NAME
20
+ end
21
+
22
+ private
23
+
24
+ def source_path
25
+ requirements[:unicode].source_path_for(DATA_FILE)
22
26
  end
23
27
  end
24
28
 
@@ -8,7 +8,7 @@ module TwitterCldr
8
8
  module Properties
9
9
 
10
10
  class UnicodeDataPropertiesImporter < PropertyImporter
11
- DATA_URL = 'ucd/UnicodeData.txt'
11
+ DATA_FILE = 'ucd/UnicodeData.txt'
12
12
 
13
13
  PROPERTIES = {
14
14
  2 => 'General_Category',
@@ -18,18 +18,20 @@ module TwitterCldr
18
18
  9 => 'Bidi_Mirrored',
19
19
  }
20
20
 
21
- def initialize(input_path, database)
22
- super(
23
- input_path: input_path,
24
- property_name: nil,
25
- data_url: DATA_URL,
26
- data_path: File.basename(DATA_URL),
27
- database: database
28
- )
21
+ requirement :unicode, Versions.unicode_version, [DATA_FILE]
22
+ output_path 'unicode_data/properties'
23
+ ruby_engine :mri
24
+
25
+ def property_name
26
+ PROPERTY_NAME
29
27
  end
30
28
 
31
29
  private
32
30
 
31
+ def source_path
32
+ requirements[:unicode].source_path_for(DATA_FILE)
33
+ end
34
+
33
35
  def load
34
36
  range_start = nil
35
37
 
@@ -8,17 +8,21 @@ module TwitterCldr
8
8
  module Properties
9
9
 
10
10
  class WordBreakPropertyImporter < PropertyImporter
11
- DATA_URL = 'ucd/auxiliary/WordBreakProperty.txt'
11
+ DATA_FILE = 'ucd/auxiliary/WordBreakProperty.txt'
12
12
  PROPERTY_NAME = 'Word_Break'
13
13
 
14
- def initialize(input_path, database)
15
- super(
16
- input_path: input_path,
17
- property_name: PROPERTY_NAME,
18
- data_url: DATA_URL,
19
- data_path: File.basename(DATA_URL),
20
- database: database
21
- )
14
+ requirement :unicode, Versions.unicode_version, [DATA_FILE]
15
+ output_path 'unicode_data/properties'
16
+ ruby_engine :mri
17
+
18
+ def property_name
19
+ PROPERTY_NAME
20
+ end
21
+
22
+ private
23
+
24
+ def source_path
25
+ requirements[:unicode].source_path_for(DATA_FILE)
22
26
  end
23
27
  end
24
28