Sha256: 3e5c9cdbebfb0b17baafee4c565426a20199b6be3e47f3795b73c806a8bddf9e

Contents?: true

Size: 1.92 KB

Versions: 10

Compression:

Stored size: 1.92 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
    }

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pragmatic_tokenizer-1.4.0 lib/pragmatic_tokenizer/languages.rb
pragmatic_tokenizer-1.3.1 lib/pragmatic_tokenizer/languages.rb
pragmatic_tokenizer-1.3.0 lib/pragmatic_tokenizer/languages.rb
pragmatic_tokenizer-1.2.0 lib/pragmatic_tokenizer/languages.rb
pragmatic_tokenizer-1.1.2 lib/pragmatic_tokenizer/languages.rb
pragmatic_tokenizer-1.1.1 lib/pragmatic_tokenizer/languages.rb
pragmatic_tokenizer-1.1.0 lib/pragmatic_tokenizer/languages.rb
pragmatic_tokenizer-1.0.2 lib/pragmatic_tokenizer/languages.rb
pragmatic_tokenizer-1.0.1 lib/pragmatic_tokenizer/languages.rb
pragmatic_tokenizer-1.0.0 lib/pragmatic_tokenizer/languages.rb