Class: TwitterCldr::Resources::TransformTestsImporter

Inherits:
Importer
  • Object
show all
Defined in:
lib/twitter_cldr/resources/transform_tests_importer.rb

Overview

This class should be used with JRuby in 1.9 mode

Constant Summary collapse

TEXT_SAMPLES =

most of these were taken from wikipedia, lol

{
  latin: ["From today's featured article"],  # @TODO test capital letters,
  serbian: ["На данашњи дан"],
  oriya: ["ଉଇକିପିଡ଼ିଆ ବ୍ୟବହାର କରିବେ କିପରି"],
  kannada: ["ಈ ತಿಂಗಳ ಪ್ರಮುಖ ದಿನಗಳು"],
  gurmukhi: ["ਅੱਜ ਇਤਿਹਾਸ ਵਿੱਚ"],
  gujarati: ["આ માસનો ઉમદા લેખ"],
  bengali: ["নির্বাচিত নিবন্ধ"],
  hangul: ["김창옥", '모든 사용자는 위키백과에 직접 참여해 확인 가능'],
  arabic: ["مقالة اليوم المختارة"],
  han: ["因此只有两场风暴因造成"],
  hiragana: ["くろねこさま"],
  katakana: ['フライドポテトサラリーマン'],
  greek: ["Αλφαβητικός Κατάλογος"],
  cyrillic: ["Влади́мир Влади́мирович Пу́тин"],
  amharic: ["ወደ ውክፔዲያ እንኳን ደህና መጡ"],
  armenian: ['Վիքիպեդիան հանրագիտարան է, որն ստեղծվել'],
  devanagari: ['विकिपीडिया सभी विषयों पर प्रामाणिक'],
  telugu: ['అనంతపురం జిల్లా తాడిపత్రిలో పెన్నా'],
  malayalam: ['ഇടുക്കിയിലെ സൂര്യനെല്ലി സ്വദേശിനിയായ'],
  tamil: ['சென்னையில் வாழும் உலோ.செந்தமிழ்க்கோதை'],
  interindic: ['  '],
  hebrew: ['על שמן של המיילדות במצרים, שפרה ופועה, נקראו'],
  simplified:  ['系统源于墨西哥以西的扰动天气区,并且位于更大规模的天气系统以内'],
  traditional: ['系統源於墨西哥以西的擾動天氣區,並且位於更大規模的天氣系統以內'],
  georgian: ['მზის სისტემა შედგება მზისა და მის გარშემო'],
  pashto: ['پښتو ژبه د لرغونو آرياني ژبو څخه يوه خپلواکه ژبه ده'],
  persian: ['فارسی یکی از زبان‌های هندواروپایی در شاخهٔ زبان‌های'],
  macedonian: ['Римскиот цар Калигула, познат по својата ексцентричност'],
  ukrainian: ['У списку наведено усіх султанів, які правили в Єгипті']
}
BGN_SAMPLES =
[:armenian, :katakana, :korean]

Constants inherited from Importer

Importer::DEFAULT_ENGINE

Instance Attribute Summary

Attributes inherited from Importer

#params, #requirements

Instance Method Summary collapse

Methods inherited from Importer

#can_import?, default_params, #import, #initialize, locales, output_path, parameter, parameters, #prepare, requirement, requirements, ruby_engine

Constructor Details

This class inherits a constructor from TwitterCldr::Resources::Importer

Instance Method Details

#executeObject



52
53
54
55
56
57
58
59
60
# File 'lib/twitter_cldr/resources/transform_tests_importer.rb', line 52

def execute
  File.open(params.fetch(:output_path), 'w+') do |f|
    f.write(
      YAML.dump(
        generate_test_data(transformer.each_transform)
      )
    )
  end
end