Module: EasyTranslate::Detection

Includes:
Threadable
Included in:
EasyTranslate
Defined in:
lib/easy_translate/detection.rb

Defined Under Namespace

Classes: DetectionRequest

Instance Method Summary collapse

Methods included from Threadable

#threaded_process

Instance Method Details

#detect(texts, options = {}, http_options = {}) ⇒ String, Array

Detect language

Parameters:

  • texts (String, Array)
    • A single string or set of strings to detect for

  • options (Hash) (defaults to: {})
    • Extra options to pass along with the request

Returns:

  • (String, Array)

    The resultant language or languages



15
16
17
# File 'lib/easy_translate/detection.rb', line 15

def detect(texts, options = {}, http_options = {})
  threaded_process(:request_detection, texts, options, http_options)
end