Module: Termium::DesignationOperations
- Included in:
- Abbreviation, EntryTerm
- Defined in:
- lib/termium/designation_operations.rb
Overview
Mixin for designation operations
Constant Summary collapse
- PART_OF_SPEECH_CODE_MAPPING =
{ "ADJ" => "adj", "N" => "noun", "V" => "verb" }.freeze
- GENDER_CODE_MAPPING =
{ "F" => "f", "M" => "m", "EPI" => "c" # this means "Epicine" }.freeze
Instance Method Summary collapse
-
#gender ⇒ Object
this means “Epicine”.
- #part_of_speech ⇒ Object
Instance Method Details
#gender ⇒ Object
this means “Epicine”
24 25 26 27 28 29 30 |
# File 'lib/termium/designation_operations.rb', line 24 def gender value = parameter.detect do |x| GENDER_CODE_MAPPING[x.abbreviation] end value ? GENDER_CODE_MAPPING[value.abbreviation] : nil end |
#part_of_speech ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/termium/designation_operations.rb', line 11 def part_of_speech value = parameter.detect do |x| PART_OF_SPEECH_CODE_MAPPING[x.abbreviation] end value ? PART_OF_SPEECH_CODE_MAPPING[value.abbreviation] : nil end |