Added missing file, refactored normalize_name out
This commit is contained in:
parent
cafe5fdce5
commit
a62d814aaf
@ -27,6 +27,14 @@ class Handler
|
||||
|
||||
nombres = [] of String
|
||||
|
||||
def normalize_name(s)
|
||||
# Remove diacritics, turn lowercase
|
||||
normalized = s.unicode_normalize(:nfkd).chars
|
||||
normalized.reject! { |c|
|
||||
!c.ascii_letter?
|
||||
}.join("").downcase
|
||||
end
|
||||
|
||||
def run(request : HTTP::Request)
|
||||
unless (body = request.body).nil?
|
||||
query = JSON.parse(body)
|
||||
@ -40,10 +48,7 @@ class Handler
|
||||
|
||||
# Remove all diacritics and whatnot
|
||||
nombres = nombres.map { |n|
|
||||
normalized = n.unicode_normalize(:nfkd).chars
|
||||
normalized.reject! { |c|
|
||||
!c.ascii_letter?
|
||||
}.join("").downcase
|
||||
normalize_name n
|
||||
}
|
||||
|
||||
puts "Processing #{nombres}"
|
||||
|
6
c-historico/shard.yml
Normal file
6
c-historico/shard.yml
Normal file
@ -0,0 +1,6 @@
|
||||
name: historico
|
||||
version: 0.1.0
|
||||
|
||||
dependencies:
|
||||
ishi:
|
||||
github: toddsundsted/ishi
|
Loading…
Reference in New Issue
Block a user