Class: JLDrill::Tanaka::Sentence

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

Constant Summary collapse

RE =
/^A: ([^\t]*)\t(.*)#ID=(.*)$/u

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(data, wordData) ⇒ Sentence

Returns a new instance of Sentence.



40
41
42
43
# File 'lib/jldrill/model/Tanaka.rb', line 40

def initialize(data, wordData)
    @data = data
    @key = JLDrill::VocabularyUsage.from_B_line(wordData)
end

Instance Method Details

#nativeLanguageObject



45
46
47
48
49
50
51
# File 'lib/jldrill/model/Tanaka.rb', line 45

def nativeLanguage()
    retVal = ""
    if RE.match(@data)
        retVal = $2
    end
    return retVal
end

#targetLanguageObject



53
54
55
56
57
58
59
# File 'lib/jldrill/model/Tanaka.rb', line 53

def targetLanguage
    retVal = ""
    if RE.match(@data)
        retVal = $3 + ": " + $1
    end
    return retVal
end