~ubuntu-branches/ubuntu/vivid/ruby-i18n/vivid

« back to all changes in this revision

Viewing changes to lib/i18n/backend/transliterator.rb

  • Committer: Package Import Robot
  • Author(s): Jonas Genannt
  • Date: 2013-11-27 19:26:54 UTC
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: package-import@ubuntu.com-20131127192654-ihh1sn3y680fvh29
Tags: upstream-0.6.5
Import upstream version 0.6.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
          "ů"=>"u", "Ű"=>"U", "ű"=>"u", "Ų"=>"U", "ų"=>"u", "Ŵ"=>"W", "ŵ"=>"w",
68
68
          "Ŷ"=>"Y", "ŷ"=>"y", "Ÿ"=>"Y", "Ź"=>"Z", "ź"=>"z", "Ż"=>"Z", "ż"=>"z",
69
69
          "Ž"=>"Z", "ž"=>"z"
70
 
        }
 
70
        }.freeze
71
71
 
72
72
        def initialize(rule = nil)
73
73
          @rule = rule
74
 
          add DEFAULT_APPROXIMATIONS
 
74
          add DEFAULT_APPROXIMATIONS.dup
75
75
          add rule if rule
76
76
        end
77
77
 
83
83
 
84
84
        private
85
85
 
86
 
          def approximations
87
 
            @approximations ||= {}
88
 
          end
 
86
        def approximations
 
87
          @approximations ||= {}
 
88
        end
89
89
 
90
 
          # Add transliteration rules to the approximations hash.
91
 
          def add(hash)
92
 
            hash.keys.each {|key| hash[key.to_s] = hash.delete(key).to_s}
93
 
            approximations.merge! hash
 
90
        # Add transliteration rules to the approximations hash.
 
91
        def add(hash)
 
92
          hash.each do |key, value|
 
93
            approximations[key.to_s] = value.to_s
94
94
          end
 
95
        end
95
96
      end
96
97
    end
97
98
  end
98
 
end
 
99
end
 
 
b'\\ No newline at end of file'