Class: AjaxCat::Request::Simple

Inherits:
Raw
  • Object
show all
Defined in:
lib/ajax-cat/request/simple.rb

Instance Attribute Summary

Attributes inherited from Raw

#lock, #processed, #sentence

Instance Method Summary collapse

Methods inherited from Raw

parse_position, #prepare_moses_request, #tokenize

Constructor Details

#initialize(sentence) ⇒ Simple

Returns a new instance of Simple.



9
10
11
12
# File 'lib/ajax-cat/request/simple.rb', line 9

def initialize(sentence)
	super(sentence)
	@best_translation = false
end

Instance Method Details

#process_line(line) ⇒ Object



18
19
20
# File 'lib/ajax-cat/request/simple.rb', line 18

def process_line(line)
	@best_translation = line.split(" ||| ")[1] unless @best_translation
end

#resultObject



14
15
16
# File 'lib/ajax-cat/request/simple.rb', line 14

def result
	@best_translation
end