Class: WenlinDbScanner::SpeechPart

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

Overview

Wraps a record in the parts-of-speech database.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#abbrevString

Returns e.g., ‘v.’; used by entries in the other databases.

Returns:

  • (String)

    e.g., ‘v.’; used by entries in the other databases



46
47
48
# File 'lib/wenlin_db_scanner/speech_parts.rb', line 46

def abbrev
  @abbrev
end

#descriptionString

Returns English-language explanation of what the part of speech is.

Returns:

  • (String)

    English-language explanation of what the part of speech is



46
47
48
# File 'lib/wenlin_db_scanner/speech_parts.rb', line 46

def description
  @description
end

#enString

Returns English name, e.g. ‘Verb’.

Returns:

  • (String)

    English name, e.g. ‘Verb’



46
47
48
# File 'lib/wenlin_db_scanner/speech_parts.rb', line 46

def en
  @en
end

#pinyinString

Returns Chinese name, in pinyin, e.g. ‘Dòngcí’.

Returns:

  • (String)

    Chinese name, in pinyin, e.g. ‘Dòngcí’



46
47
48
# File 'lib/wenlin_db_scanner/speech_parts.rb', line 46

def pinyin
  @pinyin
end

#zhString

Returns Chinese name, in Hanzi, e.g. ‘动词’.

Returns:

  • (String)

    Chinese name, in Hanzi, e.g. ‘动词’



46
47
48
# File 'lib/wenlin_db_scanner/speech_parts.rb', line 46

def zh
  @zh
end

Instance Method Details

#to_hashHash

Returns:

  • (Hash)


63
64
65
# File 'lib/wenlin_db_scanner/speech_parts.rb', line 63

def to_hash
  Hash[each_pair.to_a]
end