Class: JLDrill::Tatoeba::TatoebaExample

Inherits:
ExampleSentence show all
Defined in:
lib/jldrill/model/Tatoeba.rb

Overview

Represents an Example sentence in the Tatoeba database

Constant Summary collapse

INDEX_RE =
/^(\d*)[\t](\d*)[\t](.*)/

Instance Attribute Summary

Attributes inherited from ExampleSentence

#key

Instance Method Summary collapse

Methods inherited from ExampleSentence

#nativeOnly_to_s, #targetOnly_to_s, #to_s

Constructor Details

#initialize(targetIndex, nativeIndex, key, sentences) ⇒ TatoebaExample

Returns a new instance of TatoebaExample.



94
95
96
97
98
99
100
# File 'lib/jldrill/model/Tatoeba.rb', line 94

def initialize(targetIndex, nativeIndex, key, sentences)
    @sentences = sentences
    
    @targetIndex = targetIndex
    @nativeIndex = nativeIndex
    @key = key
end

Instance Method Details

#nativeLanguageObject



102
103
104
# File 'lib/jldrill/model/Tatoeba.rb', line 102

def nativeLanguage()
    return "#{@nativeIndex}: #{@sentences.sentenceAt(@nativeIndex)}"
end

#targetLanguageObject



106
107
108
# File 'lib/jldrill/model/Tatoeba.rb', line 106

def targetLanguage()
    return "#{@targetIndex}: #{@sentences.sentenceAt(@targetIndex)}"
end