Class: Opener::LanguageIdentifier::Server

Inherits:
Webservice
  • Object
show all
Defined in:
lib/opener/language_identifier/server.rb

Overview

A basic language identification server powered by Sinatra.

Instance Method Summary collapse

Instance Method Details

#analyze(options) ⇒ String, Symbol

Gets the Analyzed output of an input.

Parameters:

  • options (Hash)

    The options for the text_processor

Returns:

  • (String)

    output the output of the text_processor

  • (Symbol)

    type the output type ot the text_processor

Raises:

  • RunetimeError Raised when the tagging process failed.



24
25
26
27
28
29
30
# File 'lib/opener/language_identifier/server.rb', line 24

def analyze(options)
  options[:kaf] = true if options[:kaf].nil?
  processor = text_processor.new(options)
  output    = processor.run(options[:input])

  return output
end