Class: AnyStyle::Normalizer::Unicode

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

Instance Attribute Summary collapse

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, #keys_for, #map_values, #name, #skip?

Constructor Details

#initialize(form: :nfkc) ⇒ Unicode

Returns a new instance of Unicode.



30
31
32
33
# File 'lib/anystyle/normalizer/unicode.rb', line 30

def initialize(form: :nfkc)
  super()
  @form = form
end

Instance Attribute Details

#formObject

Returns the value of attribute form.



28
29
30
# File 'lib/anystyle/normalizer/unicode.rb', line 28

def form
  @form
end

Instance Method Details

#normalize(item, **opts) ⇒ Object



35
36
37
38
39
# File 'lib/anystyle/normalizer/unicode.rb', line 35

def normalize(item, **opts)
  map_values(item) do |_, value|
    value.unicode_normalize(form)
  end
end