Class: Iev::TermAttrsParser
- Inherits:
-
Object
- Object
- Iev::TermAttrsParser
- Includes:
- Cli::Ui
- Defined in:
- lib/iev/term_attrs_parser.rb
Overview
Parses information from the spreadsheet’s TERMATTRIBUTE column and alike.
Constant Summary collapse
- PARTS_OF_SPEECH =
{ "adj" => "adj", "noun" => "noun", "verb" => "verb", "名詞" => "noun", "動詞" => "verb", "形容詞" => "adj", "형용사" => "adj", "Adjektiv" => "adj", }.freeze
- PREFIX_KEYWORDS =
%w[ Präfix prefix préfixe 接尾語 접두사 przedrostek prefixo 词头 ].freeze
Instance Attribute Summary collapse
-
#gender ⇒ Object
readonly
Returns the value of attribute gender.
-
#geographical_area ⇒ Object
readonly
Returns the value of attribute geographical_area.
-
#part_of_speech ⇒ Object
readonly
Returns the value of attribute part_of_speech.
-
#plurality ⇒ Object
readonly
Returns the value of attribute plurality.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#raw_str ⇒ Object
readonly
Returns the value of attribute raw_str.
-
#src_str ⇒ Object
readonly
Returns the value of attribute src_str.
-
#usage_info ⇒ Object
readonly
Returns the value of attribute usage_info.
Instance Method Summary collapse
-
#initialize(attr_str) ⇒ TermAttrsParser
constructor
A new instance of TermAttrsParser.
- #inspect ⇒ Object
Methods included from Cli::Ui
debug, info, progress, set_ui_tag, warn
Constructor Details
#initialize(attr_str) ⇒ TermAttrsParser
Returns a new instance of TermAttrsParser.
37 38 39 40 41 |
# File 'lib/iev/term_attrs_parser.rb', line 37 def initialize(attr_str) @raw_str = attr_str.dup.freeze @src_str = decode_attrs_string(raw_str).freeze parse end |
Instance Attribute Details
#gender ⇒ Object (readonly)
Returns the value of attribute gender.
19 20 21 |
# File 'lib/iev/term_attrs_parser.rb', line 19 def gender @gender end |
#geographical_area ⇒ Object (readonly)
Returns the value of attribute geographical_area.
19 20 21 |
# File 'lib/iev/term_attrs_parser.rb', line 19 def geographical_area @geographical_area end |
#part_of_speech ⇒ Object (readonly)
Returns the value of attribute part_of_speech.
19 20 21 |
# File 'lib/iev/term_attrs_parser.rb', line 19 def part_of_speech @part_of_speech end |
#plurality ⇒ Object (readonly)
Returns the value of attribute plurality.
19 20 21 |
# File 'lib/iev/term_attrs_parser.rb', line 19 def plurality @plurality end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
19 20 21 |
# File 'lib/iev/term_attrs_parser.rb', line 19 def prefix @prefix end |
#raw_str ⇒ Object (readonly)
Returns the value of attribute raw_str.
19 20 21 |
# File 'lib/iev/term_attrs_parser.rb', line 19 def raw_str @raw_str end |
#src_str ⇒ Object (readonly)
Returns the value of attribute src_str.
19 20 21 |
# File 'lib/iev/term_attrs_parser.rb', line 19 def src_str @src_str end |
#usage_info ⇒ Object (readonly)
Returns the value of attribute usage_info.
19 20 21 |
# File 'lib/iev/term_attrs_parser.rb', line 19 def usage_info @usage_info end |
Instance Method Details
#inspect ⇒ Object
43 44 45 |
# File 'lib/iev/term_attrs_parser.rb', line 43 def inspect "<ATTRIBUTES: #{src_str}>".freeze end |