leoboiko-chou_unidecode 0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/README +14 -0
  2. data/chou_unidecode.rb +16 -0
  3. metadata +76 -0
data/README ADDED
@@ -0,0 +1,14 @@
1
+ Someday this might be a context-aware preprocessing wrapper for
2
+ unidecode. As of now, the only thing it does is to call
3
+ <tt>Unicode::normalize_KD</tt> before <tt>Unidecoder::decode</tt>;
4
+ that makes it slightly more powerful:
5
+
6
+ irb> require "rubygems"
7
+ irb> require "unidecode"
8
+ irb> "éç™①".to_ascii
9
+ "ec"
10
+ irb> require "chou_unidecode"
11
+ irb> "éç™①".to_ascii
12
+ "ecTM1"
13
+
14
+ Just require the gem and call <tt>to_ascii</tt> in strings as usual.
@@ -0,0 +1,16 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'rubygems'
3
+ require 'unicode'
4
+ require 'unidecode'
5
+
6
+ module ChouUnidecoder
7
+ def decode(str)
8
+ Unidecoder::decode(Unicode::normalize_KD(str))
9
+ end
10
+ end
11
+
12
+ class String
13
+ def to_ascii
14
+ ChouUnidecoder::decode(self)
15
+ end
16
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: leoboiko-chou_unidecode
3
+ version: !ruby/object:Gem::Version
4
+ version: "0.2"
5
+ platform: ruby
6
+ authors:
7
+ - Leonardo Boiko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-16 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: unicode
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: unidecode
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description: Someday this might be a context-aware preprocessing wrapper for unidecode. As of now, the only thing it does is to call Unicode::normalize_KD before unidecode; that makes it slightly more powerful. Just require the gem and call to_ascii in strings as usual.
36
+ email: leoboiko@gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - README
43
+ files:
44
+ - chou_unidecode.rb
45
+ - README
46
+ has_rdoc: true
47
+ homepage:
48
+ post_install_message:
49
+ rdoc_options:
50
+ - --main
51
+ - README
52
+ - --charset
53
+ - utf-8
54
+ require_paths:
55
+ - .
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: "0"
61
+ version:
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: "0"
67
+ version:
68
+ requirements: []
69
+
70
+ rubyforge_project:
71
+ rubygems_version: 1.2.0
72
+ signing_key:
73
+ specification_version: 2
74
+ summary: More powerful unidecode (Unicode to ASCII conversion).
75
+ test_files: []
76
+