Class: WenlinDbScanner::CharMeaning

Inherits:
Struct
  • Object
show all
Defined in:
lib/wenlin_db_scanner/chars.rb

Overview

Wraps a record in a dictionary database

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cantoneseArray<String>

Returns character’s pronunciation in Cantonese.

Returns:

  • (Array<String>)

    character’s pronunciation in Cantonese



179
180
181
# File 'lib/wenlin_db_scanner/chars.rb', line 179

def cantonese
  @cantonese
end

#charString

Returns 1-character string containing the defined character.

Returns:

  • (String)

    1-character string containing the defined character



179
180
181
# File 'lib/wenlin_db_scanner/chars.rb', line 179

def char
  @char
end

#complex_formsArray<String>

Returns this character is a simplified variant of them.

Returns:

  • (Array<String>)

    this character is a simplified variant of them



179
180
181
# File 'lib/wenlin_db_scanner/chars.rb', line 179

def complex_forms
  @complex_forms
end

#componentsArray<String>

Returns 1-character strings with characters that are contained in this character’s image.

Returns:

  • (Array<String>)

    1-character strings with characters that are contained in this character’s image



179
180
181
# File 'lib/wenlin_db_scanner/chars.rb', line 179

def components
  @components
end

#latin_pinyinArray<String>

Returns pinyin pronunciation(s) of the character, with with the accents removed; this is what users type to get the character.

Returns:

  • (Array<String>)

    pinyin pronunciation(s) of the character, with with the accents removed; this is what users type to get the character



179
180
181
# File 'lib/wenlin_db_scanner/chars.rb', line 179

def latin_pinyin
  @latin_pinyin
end

#meaningString

Returns the character’s definition, in English.

Returns:

  • (String)

    the character’s definition, in English



179
180
181
# File 'lib/wenlin_db_scanner/chars.rb', line 179

def meaning
  @meaning
end

#noteString

Returns e.g., “same as X” or.

Returns:

  • (String)

    e.g., “same as X” or



179
180
181
# File 'lib/wenlin_db_scanner/chars.rb', line 179

def note
  @note
end

#pinyinArray<String>

Returns pinyin pronunciation(s) of the character.

Returns:

  • (Array<String>)

    pinyin pronunciation(s) of the character



179
180
181
# File 'lib/wenlin_db_scanner/chars.rb', line 179

def pinyin
  @pinyin
end

Returns characters that are somehow related.

Returns:

  • (Array<String>)

    characters that are somehow related



179
180
181
# File 'lib/wenlin_db_scanner/chars.rb', line 179

def related
  @related
end

#simplified_formsArray<String>

Returns simplified variants of the character.

Returns:

  • (Array<String>)

    simplified variants of the character



179
180
181
# File 'lib/wenlin_db_scanner/chars.rb', line 179

def simplified_forms
  @simplified_forms
end

#variantsArray<String>

Returns other variants of the character.

Returns:

  • (Array<String>)

    other variants of the character



179
180
181
# File 'lib/wenlin_db_scanner/chars.rb', line 179

def variants
  @variants
end

Instance Method Details

#to_hashHash

Returns:

  • (Hash)


210
211
212
# File 'lib/wenlin_db_scanner/chars.rb', line 210

def to_hash
  Hash[each_pair.reject { |k, v| v.nil? }.to_a]
end