Class: AnyStyle::Normalizer::Container

Inherits:
AnyStyle::Normalizer show all
Defined in:
lib/anystyle/normalizer/container.rb

Instance Attribute Summary

Attributes inherited from AnyStyle::Normalizer

#keys, #skip

Instance Method Summary collapse

Methods inherited from AnyStyle::Normalizer

#append, #detect_language, #detect_scripts, #doi_extract, #each_value, #initialize, #keys_for, #map_values, #name, #skip?

Constructor Details

This class inherits a constructor from AnyStyle::Normalizer

Instance Method Details

#normalize(item, **opts) ⇒ Object


6
7
8
9
10
11
12
13
14
# File 'lib/anystyle/normalizer/container.rb', line 6

def normalize(item, **opts)
  map_values(item) do |_, value|
    value
      .sub(/^[Ii]n(?::|\s+the)?\s+(\p{^Ll})/, '\1')
      .sub(/^of\s+/, '')
      .sub(/^收入/, '')
      .sub(/^(\w+ )?presented at (the )?/i, '')
  end
end