Sha256: 7c43276c5421494e65bd8dc8288e2773dd11a18cb9b1457f67c0f4177fe4949a
Contents?: true
Size: 338 Bytes
Versions: 12
Compression:
Stored size: 338 Bytes
Contents
# frozen_string_literal: true module Dpl module Transliterate APPROXIMATIONS = YAML.load(File.read(File.expand_path('../../../config/transliterate.yml', __dir__))) def transliterate(string, replacement = '.') string.gsub(/[^\x00-\x7f]/u) do |char| APPROXIMATIONS[char] || replacement end end end end
Version data entries
12 entries across 12 versions & 2 rubygems