Class: Unisec::CLI::Commands::Normalize::All
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Unisec::CLI::Commands::Normalize::All
- Defined in:
- lib/unisec/cli/normalization.rb
Overview
Command unisec normalize all "example"
Example:
➜ unisec normalize all ẛ̣
Original: ẛ̣
U+1E9B U+0323
NFC: ẛ̣
U+1E9B U+0323
NFKC: ṩ
U+1E69
NFD: ẛ̣
U+017F U+0323 U+0307
NFKD: ṩ
U+0073 U+0323 U+0307
➜ unisec normalize all ẛ̣ --form nfkd
ṩ
Instance Method Summary collapse
-
#call(input: nil, **options) ⇒ Object
Normalize in all forms.
Instance Method Details
#call(input: nil, **options) ⇒ Object
Normalize in all forms
43 44 45 46 47 48 49 50 51 |
# File 'lib/unisec/cli/normalization.rb', line 43 def call(input: nil, **options) input = $stdin.read.chomp if input == '-' if options[:form].nil? puts Unisec::Normalization.new(input).display else # using send() is safe here thanks to the value whitelist puts Unisec::Normalization.send(options[:form], input) end end |