Class: JLDrill::Tatoeba::Database

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

Overview

Represents the Tatoeba database

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDatabase

Returns a new instance of Database.



263
264
265
266
267
# File 'lib/jldrill/model/Tatoeba.rb', line 263

def initialize()
    @sentences = SentenceFile.new
    @japaneseIndeces = JapaneseIndexFile.new(@sentences)
    @chineseIndeces = ChineseIndexFile.new(@sentences)
end

Instance Attribute Details

#chineseIndecesObject (readonly)

Returns the value of attribute chineseIndeces.



261
262
263
# File 'lib/jldrill/model/Tatoeba.rb', line 261

def chineseIndeces
  @chineseIndeces
end

#japaneseIndecesObject (readonly)

Returns the value of attribute japaneseIndeces.



261
262
263
# File 'lib/jldrill/model/Tatoeba.rb', line 261

def japaneseIndeces
  @japaneseIndeces
end

#sentencesObject (readonly)

Returns the value of attribute sentences.



261
262
263
# File 'lib/jldrill/model/Tatoeba.rb', line 261

def sentences
  @sentences
end

Instance Method Details

#indeces(options) ⇒ Object



269
270
271
272
273
274
275
# File 'lib/jldrill/model/Tatoeba.rb', line 269

def indeces(options)
    if options.language.eql?("Chinese")
        return @chineseIndeces
    else
        return @japaneseIndeces
    end
end

#loaded?(options) ⇒ Boolean

Returns:

  • (Boolean)


277
278
279
# File 'lib/jldrill/model/Tatoeba.rb', line 277

def loaded?(options)
    return indeces(options).loaded?
end

#search(kanji, reading, options) ⇒ Object



281
282
283
# File 'lib/jldrill/model/Tatoeba.rb', line 281

def search(kanji, reading, options)
    indeces(options).search(kanji, reading)
end