Class Jmdict::ImportSentenceReferences
In: lib/jmdict/import_sentence_references.rb
Parent: Jmdict::Import

Import sentences from Tatoeba CSV files into Kotoba

Methods

Constants

STRATEGY_PARSER_LISTENER = 'parse_sentence_references_listener'   enumeration of parser types

Public Class methods

[Source]

   # File lib/jmdict/import_sentence_references.rb, line 7
7:   def initialize
8:     @source_type     = Jmdict::Import::ENUM_SOURCE_CSV
9:   end

Public Instance methods

[Source]

    # File lib/jmdict/import_sentence_references.rb, line 24
24:   def default_directory
25:     'tatoeba'
26:   end

[Source]

    # File lib/jmdict/import_sentence_references.rb, line 28
28:   def default_version
29:     '20090904'
30:   end

[Source]

    # File lib/jmdict/import_sentence_references.rb, line 32
32:   def file_prefix
33:     'links'
34:   end

[Source]

    # File lib/jmdict/import_sentence_references.rb, line 36
36:   def file_suffix
37:     'csv'
38:   end

Import JMDict of the specified type

[Source]

    # File lib/jmdict/import_sentence_references.rb, line 12
12:   def import(
13:     source_location, 
14:     a_source_type    = source_type, 
15:     source_version   = 'not_set', 
16:     maximum_imported = nil, 
17:     parser_strategy  = Jmdict::ImportSentenceReferences::STRATEGY_PARSER_LISTENER
18:   )
19:     @source_type = a_source_type
20:     raise "We do not know how to handle the parser strategy [#{parser_strategy}]" unless Jmdict::ImportSentenceReferences.valid_strategy?(parser_strategy)
21:     parse(source_location, @source_type, source_version, maximum_imported, parser_strategy)
22:   end

[Source]

    # File lib/jmdict/import_sentence_references.rb, line 44
44:   def parse_sentence_references_listener
45:     listener = Jmdict::ImportSentenceReferencesListener.new(@_source_location, @_source_version, @_maximum_imported)
46:     return do_parse(listener)
47:   end

[Source]

    # File lib/jmdict/import_sentence_references.rb, line 40
40:   def source_type
41:     return @source_type
42:   end

[Validate]