Module: JtcgLocaleDetector

Defined in:
lib/jtcg_locale_detector.rb,
lib/jtcg_locale_detector/client.rb,
lib/jtcg_locale_detector/version.rb,
lib/jtcg_locale_detector/detector.rb

Defined Under Namespace

Classes: Client, Detector, Error

Constant Summary collapse

VERSION =
"1.0.2".freeze

Class Method Summary collapse

Class Method Details

.detect(text, **options) ⇒ Object

Convenience method for quick detection



9
10
11
12
# File 'lib/jtcg_locale_detector.rb', line 9

def self.detect(text, **options)
  client = Client.new(**options)
  client.detect(text)
end

.detect_batch(texts, **options) ⇒ Object

Batch detection



15
16
17
18
# File 'lib/jtcg_locale_detector.rb', line 15

def self.detect_batch(texts, **options)
  client = Client.new(**options)
  client.detect_batch(texts)
end

.detect_file(file_path, **options) ⇒ Object

Detect from file



21
22
23
24
# File 'lib/jtcg_locale_detector.rb', line 21

def self.detect_file(file_path, **options)
  client = Client.new(**options)
  client.detect_file(file_path)
end