Class Jmdict::ImportKrad
In: lib/jmdict/import_krad.rb
Parent: Jmdict::Import

Import Kanji radicals into Kotoba

See www.csse.monash.edu.au/~jwb/kradinf.html

Methods

Constants

STRATEGY_PARSER_LISTENER = 'parse_krad_reader'   enumeration of parser types

Public Instance methods

[Source]

    # File lib/jmdict/import_krad.rb, line 21
21:   def default_directory
22:     'krad'
23:   end

[Source]

    # File lib/jmdict/import_krad.rb, line 25
25:   def default_version
26:     '2009_04_01'
27:   end

[Source]

    # File lib/jmdict/import_krad.rb, line 29
29:   def file_prefix
30:     'kradfile_'
31:   end

[Source]

    # File lib/jmdict/import_krad.rb, line 33
33:   def file_suffix
34:     'txt'
35:   end

Import JMDict of the specified type

[Source]

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

[Source]

    # File lib/jmdict/import_krad.rb, line 37
37:   def parse_krad_reader
38:     reader = Jmdict::ImportKradReader.new(@_source_location, @_source_version, @_maximum_imported)
39:     return do_read(reader)
40:   end

[Validate]