Class: JLDrill::Tanaka::Sentence
- Inherits:
-
ExampleSentence
- Object
- ExampleSentence
- JLDrill::Tanaka::Sentence
- Defined in:
- lib/jldrill/model/Tanaka.rb
Constant Summary collapse
- RE =
/^A: ([^\t]*)\t(.*)#ID=(.*)$/u
Instance Attribute Summary
Attributes inherited from ExampleSentence
Instance Method Summary collapse
-
#initialize(data, wordData) ⇒ Sentence
constructor
A new instance of Sentence.
- #nativeLanguage ⇒ Object
- #targetLanguage ⇒ Object
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
#nativeLanguage ⇒ Object
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 |
#targetLanguage ⇒ Object
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 |