Module: Utilities::CollectingMethods

Defined in:
lib/utilities/collecting_methods.rb

Defined Under Namespace

Classes: MethodFromLabel

Constant Summary collapse

METHODS =
{'malaise trap' => 'Malaise trap',
             'malaise' => 'Malaise trap',
             'sweeping' => 'sweep net',
             'sweep netting' => 'sweep net',
             'sweep net' => 'sweep net',
             'sweepnet' => 'sweep net',

             'uv light trap' => 'UV light trap',
             'uv trap' => 'UV light trap',
             'uv light' => 'UV light',
             'u.v. light' => 'UV light',
             'blacklight trap' => 'black light trap',
             'black light trap' => 'black light trap',
             'hg light trap' => 'mercury vapor light trap',
             'blacklight' => 'black light',
             'light trap' => 'light trap',
             'mercury vapor' => 'mercury vapor light',
             'hg. vapor' => 'mercury vapor light',
             'hg vapor' => 'mercury vapor light',
             'mv light' => 'mercury vapor light',
             'm.v. light' => 'mercury vapor light',
             'mercury vapour' => 'mercury vapor light',
             'merc. vapor' => 'mercury vapor light',
             'at light' => 'at light',
             'light' => 'at light',

             'hand collecting' => 'hand collecting',
             'hand collect' => 'hand collecting',
             'handpick' => 'hand collecting',
             'hand pick' => 'hand collecting',
             'hand collection' => 'hand collecting',

             'suction trap' => 'suction trap',
             'd-vac' => 'D-vac',
             'aspirator' => 'aspirator',
             'vacuum' => 'vacuum',

             'dip net' => 'dip net',
             'dipnet' => 'dip net',
             'aerial net' => 'aerial net',
             'berlese' => 'Berlese funnel',
             'interception net' => 'interception net',

             'pan trap, yellow' => 'pan trap, yellow',
             'yellow pan trap' => 'pan trap, yellow',
             'blue pan trap' => 'pan trap, blue',
             'pan trap, blue' => 'pan trap, blue',
             'red pan trap' => 'pan trap, red',
             'pan trap, red' => 'pan trap, red',
             'pan trap' => 'pan trap',

             'pitfall' => 'pitfall trap',

             'beating sheet' => 'beating sheet',
             'beat sheet' => 'beating sheet',
             'beating' => 'beating sheet',
             'flight trap' => 'flight trap',
             'aerial sweep net' => 'flight trap',
             'bait trap' => 'bait trap',
             'fogging' => 'fogging',
}.freeze

Class Method Summary collapse

Class Method Details

.method_regex_from_verbatim_label(text) ⇒ Object



75
76
77
78
79
80
81
82
83
# File 'lib/utilities/collecting_methods.rb', line 75

def self.method_regex_from_verbatim_label(text)
  text = ' ' + text.downcase.squish + ' '
  METHODS.each do |k, v|
    if text =~ /[\s,.;:\/|\(\)-]#{k}[\s,.;:\/|\(\)-]/
      return {verbatim_method: v}
    end
  end
  return {}
end