Class: JLDrill::Tatoeba::Database
- Inherits:
-
Object
- Object
- JLDrill::Tatoeba::Database
- Defined in:
- lib/jldrill/model/Tatoeba.rb
Overview
Represents the Tatoeba database
Instance Attribute Summary collapse
-
#chineseIndeces ⇒ Object
readonly
Returns the value of attribute chineseIndeces.
-
#japaneseIndeces ⇒ Object
readonly
Returns the value of attribute japaneseIndeces.
-
#sentences ⇒ Object
readonly
Returns the value of attribute sentences.
Instance Method Summary collapse
- #indeces(options) ⇒ Object
-
#initialize ⇒ Database
constructor
A new instance of Database.
- #loaded?(options) ⇒ Boolean
- #search(kanji, reading, options) ⇒ Object
Constructor Details
#initialize ⇒ Database
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
#chineseIndeces ⇒ Object (readonly)
Returns the value of attribute chineseIndeces.
261 262 263 |
# File 'lib/jldrill/model/Tatoeba.rb', line 261 def chineseIndeces @chineseIndeces end |
#japaneseIndeces ⇒ Object (readonly)
Returns the value of attribute japaneseIndeces.
261 262 263 |
# File 'lib/jldrill/model/Tatoeba.rb', line 261 def japaneseIndeces @japaneseIndeces end |
#sentences ⇒ Object (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() if .language.eql?("Chinese") return @chineseIndeces else return @japaneseIndeces end end |
#loaded?(options) ⇒ Boolean
277 278 279 |
# File 'lib/jldrill/model/Tatoeba.rb', line 277 def loaded?() return indeces().loaded? end |
#search(kanji, reading, options) ⇒ Object
281 282 283 |
# File 'lib/jldrill/model/Tatoeba.rb', line 281 def search(kanji, reading, ) indeces().search(kanji, reading) end |