Class: AnyStyle::Normalizer::Unicode
- Inherits:
-
AnyStyle::Normalizer
- Object
- AnyStyle::Normalizer
- AnyStyle::Normalizer::Unicode
- Defined in:
- lib/anystyle/normalizer/unicode.rb
Instance Attribute Summary collapse
-
#form ⇒ Object
Returns the value of attribute form.
Attributes inherited from AnyStyle::Normalizer
Instance Method Summary collapse
-
#initialize(form: :nfkc) ⇒ Unicode
constructor
A new instance of Unicode.
- #normalize(item, **opts) ⇒ Object
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
#form ⇒ Object
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 |