Sha256: 9e774a6252b1fe0a7b5ad27ef4835821c1a0bb0823659d5bda05c63fd7d2500c

Contents?: true

Size: 1.98 KB

Versions: 5

Compression:

Stored size: 1.98 KB

Contents

require 'pragmatic_tokenizer/languages/common'

require 'pragmatic_tokenizer/languages/english'
require 'pragmatic_tokenizer/languages/arabic'
require 'pragmatic_tokenizer/languages/bulgarian'
require 'pragmatic_tokenizer/languages/catalan'
require 'pragmatic_tokenizer/languages/czech'
require 'pragmatic_tokenizer/languages/danish'
require 'pragmatic_tokenizer/languages/deutsch'
require 'pragmatic_tokenizer/languages/greek'
require 'pragmatic_tokenizer/languages/spanish'
require 'pragmatic_tokenizer/languages/persian'
require 'pragmatic_tokenizer/languages/finnish'
require 'pragmatic_tokenizer/languages/french'
require 'pragmatic_tokenizer/languages/indonesian'
require 'pragmatic_tokenizer/languages/italian'
require 'pragmatic_tokenizer/languages/latvian'
require 'pragmatic_tokenizer/languages/dutch'
require 'pragmatic_tokenizer/languages/norwegian'
require 'pragmatic_tokenizer/languages/polish'
require 'pragmatic_tokenizer/languages/portuguese'
require 'pragmatic_tokenizer/languages/romanian'
require 'pragmatic_tokenizer/languages/russian'
require 'pragmatic_tokenizer/languages/slovak'
require 'pragmatic_tokenizer/languages/swedish'
require 'pragmatic_tokenizer/languages/turkish'

module PragmaticTokenizer
  module Languages
    LANGUAGE_CODES = {
        'en' => English,
        'ar' => Arabic,
        'bg' => Bulgarian,
        'ca' => Catalan,
        'cs' => Czech,
        'da' => Danish,
        'de' => Deutsch,
        'el' => Greek,
        'es' => Spanish,
        'fa' => Persian,
        'fi' => Finnish,
        'fr' => French,
        'id' => Indonesian,
        'it' => Italian,
        'lv' => Latvian,
        'nl' => Dutch,
        'nn' => Norwegian,
        'nb' => Norwegian,
        'no' => Norwegian,
        'pl' => Polish,
        'pt' => Portuguese,
        'ro' => Romanian,
        'ru' => Russian,
        'sk' => Slovak,
        'sv' => Swedish,
        'tr' => Turkish
    }.freeze

    def self.get_language_by_code(code)
      LANGUAGE_CODES[code] || Common
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pragmatic_tokenizer-1.6.0 lib/pragmatic_tokenizer/languages.rb
pragmatic_tokenizer-2.1.0 lib/pragmatic_tokenizer/languages.rb
pragmatic_tokenizer-1.5.1 lib/pragmatic_tokenizer/languages.rb
pragmatic_tokenizer-2.0.0 lib/pragmatic_tokenizer/languages.rb
pragmatic_tokenizer-1.5.0 lib/pragmatic_tokenizer/languages.rb