text_cleaner 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +29 -0
- data/Rakefile +2 -0
- data/lib/text_cleaner.rb +268 -0
- data/lib/text_cleaner/version.rb +3 -0
- data/text_cleaner.gemspec +17 -0
- metadata +55 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Jason Amster
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# TextCleaner
|
2
|
+
|
3
|
+
Simple gem does one thing, and one thing only... Turns funky chars such as [FILL IN HERE] to the proper HTML Encodings such as [FILL IN HERE].
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'text_cleaner'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install text_cleaner
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TextCleaner.clean(input_text)
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/lib/text_cleaner.rb
ADDED
@@ -0,0 +1,268 @@
|
|
1
|
+
require "text_cleaner/version"
|
2
|
+
|
3
|
+
module TextCleaner
|
4
|
+
DICTIONARY = <<-EOS
|
5
|
+
quotation mark " " " " " "
|
6
|
+
ampersand & & & & & &
|
7
|
+
less-than sign < < < < < <
|
8
|
+
greater-than sign > > > > > >
|
9
|
+
Latin capital ligature OE Œ Œ Œ Œ Œ Œ
|
10
|
+
Latin small ligature oe œ œ œ œ œ œ
|
11
|
+
Latin capital letter S with caron Š Š Š Š Š Š
|
12
|
+
Latin small letter s with caron š š š š š š
|
13
|
+
Latin capital letter Y with diaeresis Ÿ Ÿ Ÿ Ÿ Ÿ Ÿ
|
14
|
+
modifier letter circumflex accent ˆ ˆ ˆ ˆ ˆ ˆ
|
15
|
+
small tilde ˜ ˜ ˜ ˜ ˜ ˜
|
16
|
+
en space      
|
17
|
+
em space      
|
18
|
+
thin space      
|
19
|
+
zero width non-joiner ‌ ‌ ‌
|
20
|
+
zero width joiner ‍ ‍ ‍
|
21
|
+
left-to-right mark ‎ ‎ ‎
|
22
|
+
right-to-left mark ‏ ‏ ‏
|
23
|
+
en dash – – – – – –
|
24
|
+
em dash — — — — — —
|
25
|
+
amster right single quotation mark ’ ’ ’ ’ ’ ’
|
26
|
+
left single quotation mark ‘ ‘ ‘ ‘ ‘ ‘
|
27
|
+
right single quotation mark ’ ’ ’ ’ ’ ’
|
28
|
+
single low-9 quotation mark ‚ ‚ ‚ ‚ ‚ ‚
|
29
|
+
left double quotation mark “ “ “ “ “ “
|
30
|
+
right double quotation mark ” ” ” ” ” ”
|
31
|
+
double low-9 quotation mark „ „ „ „ „ „
|
32
|
+
dagger † † † † † †
|
33
|
+
double dagger ‡ ‡ ‡ ‡ ‡ ‡
|
34
|
+
per mille sign ‰ ‰ ‰ ‰ ‰ ‰
|
35
|
+
single left-pointing angle quotation mark ‹ ‹ ‹ ‹ ‹ ‹
|
36
|
+
single right-pointing angle quotation mark › › › › › ›
|
37
|
+
euro sign € € € € € €
|
38
|
+
Latin small f with hook = function = florin ƒ ƒ ƒ ƒ ƒ ƒ
|
39
|
+
Greek capital letter alpha Α Α Α Α Α Α
|
40
|
+
Greek capital letter beta Β Β Β Β Β Β
|
41
|
+
Greek capital letter gamma Γ Γ Γ Γ Γ Γ
|
42
|
+
Greek capital letter delta Δ Δ Δ Δ Δ Δ
|
43
|
+
Greek capital letter epsilon Ε Ε Ε Ε Ε Ε
|
44
|
+
Greek capital letter zeta Ζ Ζ Ζ Ζ Ζ Ζ
|
45
|
+
Greek capital letter eta Η Η Η Η Η Η
|
46
|
+
Greek capital letter theta Θ Θ Θ Θ Θ Θ
|
47
|
+
Greek capital letter iota Ι Ι Ι Ι Ι Ι
|
48
|
+
Greek capital letter kappa Κ Κ Κ Κ Κ Κ
|
49
|
+
Greek capital letter lambda Λ Λ Λ Λ Λ Λ
|
50
|
+
Greek capital letter mu Μ Μ Μ Μ Μ Μ
|
51
|
+
Greek capital letter nu Ν Ν Ν Ν Ν Ν
|
52
|
+
Greek capital letter xi Ξ Ξ Ξ Ξ Ξ Ξ
|
53
|
+
Greek capital letter omicron Ο Ο Ο Ο Ο Ο
|
54
|
+
Greek capital letter pi Π Π Π Π Π Π
|
55
|
+
Greek capital letter rho Ρ Ρ Ρ Ρ Ρ Ρ
|
56
|
+
Greek capital letter sigma Σ Σ Σ Σ Σ Σ
|
57
|
+
Greek capital letter tau Τ Τ Τ Τ Τ Τ
|
58
|
+
Greek capital letter upsilon Υ Υ Υ Υ Υ Υ
|
59
|
+
Greek capital letter phi Φ Φ Φ Φ Φ Φ
|
60
|
+
Greek capital letter chi Χ Χ Χ Χ Χ Χ
|
61
|
+
Greek capital letter psi Ψ Ψ Ψ Ψ Ψ Ψ
|
62
|
+
Greek capital letter omega Ω Ω Ω Ω Ω Ω
|
63
|
+
Greek small letter alpha α α α α α α
|
64
|
+
Greek small letter beta β β β β β β
|
65
|
+
Greek small letter gamma γ γ γ γ γ γ
|
66
|
+
Greek small letter delta δ δ δ δ δ δ
|
67
|
+
Greek small letter epsilon ε ε ε ε ε ε
|
68
|
+
Greek small letter zeta ζ ζ ζ ζ ζ ζ
|
69
|
+
Greek small letter eta η η η η η η
|
70
|
+
Greek small letter theta θ θ θ θ θ θ
|
71
|
+
Greek small letter iota ι ι ι ι ι ι
|
72
|
+
Greek small letter kappa κ κ κ κ κ κ
|
73
|
+
Greek small letter lambda λ λ λ λ λ λ
|
74
|
+
Greek small letter mu μ μ μ μ μ μ
|
75
|
+
Greek small letter nu ν ν ν ν ν ν
|
76
|
+
Greek small letter xi ξ ξ ξ ξ ξ ξ
|
77
|
+
Greek small letter omicron ο ο ο ο ο ο
|
78
|
+
Greek small letter pi π π π π π π
|
79
|
+
Greek small letter rho ρ ρ ρ ρ ρ ρ
|
80
|
+
Greek small letter final sigma ς ς ς ς ς ς
|
81
|
+
Greek small letter sigma σ σ σ σ σ σ
|
82
|
+
Greek small letter tau τ τ τ τ τ τ
|
83
|
+
Greek small letter upsilon υ υ υ υ υ υ
|
84
|
+
Greek small letter phi φ φ φ φ φ φ
|
85
|
+
Greek small letter chi χ χ χ χ χ χ
|
86
|
+
Greek small letter psi ψ ψ ψ ψ ψ ψ
|
87
|
+
Greek small letter omega ω ω ω ω ω ω
|
88
|
+
Greek small letter theta symbol ϑ ϑ ϑ ϑ ϑ ϑ
|
89
|
+
Greek upsilon with hook symbol ϒ ϒ ϒ ϒ ϒ ϒ
|
90
|
+
Greek pi symbol ϖ ϖ ϖ ϖ ϖ ϖ
|
91
|
+
bullet = black small circle • • • • • •
|
92
|
+
horizontal ellipsis = three dot leader … … … … … …
|
93
|
+
prime = minutes = feet ′ ′ ′ ′ ′ ′
|
94
|
+
double prime = seconds = inches ″ ″ ″ ″ ″ ″
|
95
|
+
overline = spacing overscore ‾ ‾ ‾ ‾ ‾ ‾
|
96
|
+
fraction slash ⁄ ⁄ ⁄ ⁄ ⁄ ⁄
|
97
|
+
script capital P = power set = Weierstrass p ℘ ℘ ℘ ℘ ℘ ℘
|
98
|
+
blackletter capital I = imaginary part ℑ ℑ ℑ ℑ ℑ ℑ
|
99
|
+
blackletter capital R = real part symbol ℜ ℜ ℜ ℜ ℜ ℜ
|
100
|
+
trade mark sign ™ ™ ™ ™ ™ ™
|
101
|
+
alef symbol = first transfinite cardinal ℵ ℵ ℵ ℵ ℵ ℵ
|
102
|
+
leftwards arrow ← ← ← ← ← ←
|
103
|
+
upwards arrow ↑ ↑ ↑ ↑ ↑ ↑
|
104
|
+
rightwards arrow → → → → → →
|
105
|
+
downwards arrow ↓ ↓ ↓ ↓ ↓ ↓
|
106
|
+
left right arrow ↔ ↔ ↔ ↔ ↔ ↔
|
107
|
+
downwards arrow with corner leftwards = carriage return ↵ ↵ ↵ ↵ ↵ ↵
|
108
|
+
leftwards double arrow ⇐ ⇐ ⇐ ⇐ ⇐ ⇐
|
109
|
+
upwards double arrow ⇑ ⇑ ⇑ ⇑ ⇑ ⇑
|
110
|
+
rightwards double arrow ⇒ ⇒ ⇒ ⇒ ⇒ ⇒
|
111
|
+
downwards double arrow ⇓ ⇓ ⇓ ⇓ ⇓ ⇓
|
112
|
+
left right double arrow ⇔ ⇔ ⇔ ⇔ ⇔ ⇔
|
113
|
+
for all ∀ ∀ ∀ ∀ ∀ ∀
|
114
|
+
partial differential ∂ ∂ ∂ ∂ ∂ ∂
|
115
|
+
there exists ∃ ∃ ∃ ∃ ∃ ∃
|
116
|
+
empty set = null set = diameter ∅ ∅ ∅ ∅ ∅ ∅
|
117
|
+
nabla = backward difference ∇ ∇ ∇ ∇ ∇ ∇
|
118
|
+
element of ∈ ∈ ∈ ∈ ∈ ∈
|
119
|
+
not an element of ∉ ∉ ∉ ∉ ∉ ∉
|
120
|
+
contains as member ∋ ∋ ∋ ∋ ∋ ∋
|
121
|
+
n-ary product = product sign ∏ ∏ ∏ ∏ ∏ ∏
|
122
|
+
n-ary sumation ∑ ∑ ∑ ∑ ∑ ∑
|
123
|
+
minus sign − − − − − −
|
124
|
+
asterisk operator ∗ ∗ ∗ ∗ ∗ ∗
|
125
|
+
square root = radical sign √ √ √ √ √ √
|
126
|
+
proportional to ∝ ∝ ∝ ∝ ∝ ∝
|
127
|
+
infinity ∞ ∞ ∞ ∞ ∞ ∞
|
128
|
+
angle ∠ ∠ ∠ ∠ ∠ ∠
|
129
|
+
logical and = wedge ∧ ∧ ∧ ∧ ∧ ∧
|
130
|
+
logical or = vee ∨ ∨ ∨ ∨ ∨ ∨
|
131
|
+
intersection = cap ∩ ∩ ∩ ∩ ∩ ∩
|
132
|
+
union = cup ∪ ∪ ∪ ∪ ∪ ∪
|
133
|
+
integral ∫ ∫ ∫ ∫ ∫ ∫
|
134
|
+
therefore ∴ ∴ ∴ ∴ ∴ ∴
|
135
|
+
tilde operator = varies with = similar to ∼ ∼ ∼ ∼ ∼ ∼
|
136
|
+
approximately equal to ≅ ≅ ≅ ≅ ≅ ≅
|
137
|
+
almost equal to = asymptotic to ≈ ≈ ≈ ≈ ≈ ≈
|
138
|
+
not equal to ≠ ≠ ≠ ≠ ≠ ≠
|
139
|
+
identical to ≡ ≡ ≡ ≡ ≡ ≡
|
140
|
+
less-than or equal to ≤ ≤ ≤ ≤ ≤ ≤
|
141
|
+
greater-than or equal to ≥ ≥ ≥ ≥ ≥ ≥
|
142
|
+
subset of ⊂ ⊂ ⊂ ⊂ ⊂ ⊂
|
143
|
+
superset of ⊃ ⊃ ⊃ ⊃ ⊃ ⊃
|
144
|
+
not a subset of ⊄ ⊄ ⊄ ⊄ ⊄ ⊄
|
145
|
+
subset of or equal to ⊆ ⊆ ⊆ ⊆ ⊆ ⊆
|
146
|
+
superset of or equal to ⊇ ⊇ ⊇ ⊇ ⊇ ⊇
|
147
|
+
circled plus = direct sum ⊕ ⊕ ⊕ ⊕ ⊕ ⊕
|
148
|
+
circled times = vector product ⊗ ⊗ ⊗ ⊗ ⊗ ⊗
|
149
|
+
up tack = orthogonal to = perpendicular ⊥ ⊥ ⊥ ⊥ ⊥ ⊥
|
150
|
+
dot operator ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
|
151
|
+
left ceiling = APL upstile ⌈ ⌈ ⌈ ⌈ ⌈ ⌈
|
152
|
+
right ceiling ⌉ ⌉ ⌉ ⌉ ⌉ ⌉
|
153
|
+
left floor = APL downstile ⌊ ⌊ ⌊ ⌊ ⌊ ⌊
|
154
|
+
right floor ⌋ ⌋ ⌋ ⌋ ⌋ ⌋
|
155
|
+
left-pointing angle bracket = bra ⟨ 〈 〈 〈 〈 〈
|
156
|
+
right-pointing angle bracket = ket ⟩ 〉 〉 〉 〉 〉
|
157
|
+
lozenge ◊ ◊ ◊ ◊ ◊ ◊
|
158
|
+
black spade suit ♠ ♠ ♠ ♠ ♠ ♠
|
159
|
+
black club suit = shamrock ♣ ♣ ♣ ♣ ♣ ♣
|
160
|
+
black heart suit = valentine ♥ ♥ ♥ ♥ ♥ ♥
|
161
|
+
black diamond suit ♦ ♦ ♦ ♦ ♦ ♦
|
162
|
+
inverted exclamation mark ¡ ¡ ¡ ¡ ¡ ¡
|
163
|
+
cent sign ¢ ¢ ¢ ¢ ¢ ¢
|
164
|
+
pound sign £ £ £ £ £ £
|
165
|
+
currency sign ¤ ¤ ¤ ¤ ¤ ¤
|
166
|
+
yen sign = yuan sign ¥ ¥ ¥ ¥ ¥ ¥
|
167
|
+
broken bar = broken vertical bar ¦ ¦ ¦ ¦ ¦ ¦
|
168
|
+
section sign § § § § § §
|
169
|
+
diaeresis = spacing diaeresis ¨ ¨ ¨ ¨ ¨ ¨
|
170
|
+
copyright sign © © © © © ©
|
171
|
+
feminine ordinal indicator ª ª ª ª ª ª
|
172
|
+
left-pointing double angle quotation mark = left pointing guillemet « « « « « «
|
173
|
+
not sign ¬ ¬ ¬ ¬ ¬ ¬
|
174
|
+
soft hyphen = discretionary hyphen ­ ­ ­
|
175
|
+
registered sign = registered trade mark sign ® ® ® ® ® ®
|
176
|
+
macron = spacing macron = overline = APL overbar ¯ ¯ ¯ ¯ ¯ ¯
|
177
|
+
degree sign ° ° ° ° ° °
|
178
|
+
plus-minus sign = plus-or-minus sign ± ± ± ± ± ±
|
179
|
+
superscript two = superscript digit two = squared ² ² ² ² ² ²
|
180
|
+
superscript three = superscript digit three = cubed ³ ³ ³ ³ ³ ³
|
181
|
+
acute accent = spacing acute ´ ´ ´ ´ ´ ´
|
182
|
+
micro sign µ µ µ µ µ µ
|
183
|
+
pilcrow sign = paragraph sign ¶ ¶ ¶ ¶ ¶ ¶
|
184
|
+
middle dot = Georgian comma = Greek middle dot · · · · · ·
|
185
|
+
cedilla = spacing cedilla ¸ ¸ ¸ ¸ ¸ ¸
|
186
|
+
superscript one = superscript digit one ¹ ¹ ¹ ¹ ¹ ¹
|
187
|
+
masculine ordinal indicator º º º º º º
|
188
|
+
right-pointing double angle quotation mark = right pointing guillemet » » » » » »
|
189
|
+
vulgar fraction one quarter = fraction one quarter ¼ ¼ ¼ ¼ ¼ ¼
|
190
|
+
vulgar fraction one half = fraction one half ½ ½ ½ ½ ½ ½
|
191
|
+
vulgar fraction three quarters = fraction three quarters ¾ ¾ ¾ ¾ ¾ ¾
|
192
|
+
inverted question mark = turned question mark ¿ ¿ ¿ ¿ ¿ ¿
|
193
|
+
Latin capital letter A with grave = Latin capital letter A grave À À À À À À
|
194
|
+
Latin capital letter A with acute Á Á Á Á Á Á
|
195
|
+
Latin capital letter A with circumflex      Â
|
196
|
+
Latin capital letter A with tilde à à à à à Ã
|
197
|
+
Latin capital letter A with diaeresis Ä Ä Ä Ä Ä Ä
|
198
|
+
Latin capital letter A with ring above = Latin capital letter A ring Å Å Å Å Å Å
|
199
|
+
Latin capital letter AE = Latin capital ligature AE Æ Æ Æ Æ Æ Æ
|
200
|
+
Latin capital letter C with cedilla Ç Ç Ç Ç Ç Ç
|
201
|
+
Latin capital letter E with grave È È È È È È
|
202
|
+
Latin capital letter E with acute É É É É É É
|
203
|
+
Latin capital letter E with circumflex Ê Ê Ê Ê Ê Ê
|
204
|
+
Latin capital letter E with diaeresis Ë Ë Ë Ë Ë Ë
|
205
|
+
Latin capital letter I with grave Ì Ì Ì Ì Ì Ì
|
206
|
+
Latin capital letter I with acute Í Í Í Í Í Í
|
207
|
+
Latin capital letter I with circumflex Î Î Î Î Î Î
|
208
|
+
Latin capital letter I with diaeresis Ï Ï Ï Ï Ï Ï
|
209
|
+
Latin capital letter ETH Ð Ð Ð Ð Ð Ð
|
210
|
+
Latin capital letter N with tilde Ñ Ñ Ñ Ñ Ñ Ñ
|
211
|
+
Latin capital letter O with grave Ò Ò Ò Ò Ò Ò
|
212
|
+
Latin capital letter O with acute Ó Ó Ó Ó Ó Ó
|
213
|
+
Latin capital letter O with circumflex Ô Ô Ô Ô Ô Ô
|
214
|
+
Latin capital letter O with tilde Õ Õ Õ Õ Õ Õ
|
215
|
+
Latin capital letter O with diaeresis Ö Ö Ö Ö Ö Ö
|
216
|
+
multiplication sign × × × × × ×
|
217
|
+
Latin capital letter O with stroke = Latin capital letter O slash Ø Ø Ø Ø Ø Ø
|
218
|
+
Latin capital letter U with grave Ù Ù Ù Ù Ù Ù
|
219
|
+
Latin capital letter U with acute Ú Ú Ú Ú Ú Ú
|
220
|
+
Latin capital letter U with circumflex Û Û Û Û Û Û
|
221
|
+
Latin capital letter U with diaeresis Ü Ü Ü Ü Ü Ü
|
222
|
+
Latin capital letter Y with acute Ý Ý Ý Ý Ý Ý
|
223
|
+
Latin capital letter THORN Þ Þ Þ Þ Þ Þ
|
224
|
+
Latin small letter sharp s = ess-zed ß ß ß ß ß ß
|
225
|
+
Latin small letter a with grave = Latin small letter a grave à à à à à à
|
226
|
+
Latin small letter a with acute á á á á á á
|
227
|
+
Latin small letter a with circumflex â â â â â â
|
228
|
+
Latin small letter a with tilde ã ã ã ã ã ã
|
229
|
+
Latin small letter a with diaeresis ä ä ä ä ä ä
|
230
|
+
Latin small letter a with ring above = Latin small letter a ring å å å å å å
|
231
|
+
Latin small letter ae = Latin small ligature ae æ æ æ æ æ æ
|
232
|
+
Latin small letter c with cedilla ç ç ç ç ç ç
|
233
|
+
Latin small letter e with grave è è è è è è
|
234
|
+
Latin small letter e with acute é é é é é é
|
235
|
+
Latin small letter e with circumflex ê ê ê ê ê ê
|
236
|
+
Latin small letter e with diaeresis ë ë ë ë ë ë
|
237
|
+
Latin small letter i with grave ì ì ì ì ì ì
|
238
|
+
Latin small letter i with acute í í í í í í
|
239
|
+
Latin small letter i with circumflex î î î î î î
|
240
|
+
Latin small letter i with diaeresis ï ï ï ï ï ï
|
241
|
+
Latin small letter eth ð ð ð ð ð ð
|
242
|
+
Latin small letter n with tilde ñ ñ ñ ñ ñ ñ
|
243
|
+
Latin small letter o with grave ò ò ò ò ò ò
|
244
|
+
Latin small letter o with acute ó ó ó ó ó ó
|
245
|
+
Latin small letter o with circumflex ô ô ô ô ô ô
|
246
|
+
Latin small letter o with tilde õ õ õ õ õ õ
|
247
|
+
Latin small letter o with diaeresis ö ö ö ö ö ö
|
248
|
+
division sign ÷ ÷ ÷ ÷ ÷ ÷
|
249
|
+
Latin small letter o with stroke = Latin small letter o slash ø ø ø ø ø ø
|
250
|
+
Latin small letter u with grave ù ù ù ù ù ù
|
251
|
+
Latin small letter u with acute ú ú ú ú ú ú
|
252
|
+
Latin small letter u with circumflex û û û û û û
|
253
|
+
Latin small letter u with diaeresis ü ü ü ü ü ü
|
254
|
+
Latin small letter y with acute ý ý ý ý ý ý
|
255
|
+
Latin small letter thorn þ þ þ þ þ þ
|
256
|
+
Latin small letter y with diaeresis ÿ ÿ ÿ ÿ ÿ ÿ
|
257
|
+
EOS
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
def self.clean(input_text)
|
262
|
+
DICTIONARY.each_line do |line|
|
263
|
+
name, html, hex, oct, display, display2, display3 = line.split(/\t/)
|
264
|
+
input_text.gsub!(display.strip, html.strip)
|
265
|
+
end
|
266
|
+
input_text
|
267
|
+
end
|
268
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/text_cleaner/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Jason Amster"]
|
6
|
+
gem.email = ["jayamster@gmail.com"]
|
7
|
+
gem.description = %q{Simple gem does one thing, and one thing only... Turns funky chars such as [FILL IN HERE] to the proper HTML Encodings such as [FILL IN HERE].}
|
8
|
+
gem.summary = %q{Simple gem does one thing, and one thing only... Turns funky chars such as [FILL IN HERE] to the proper HTML Encodings such as [FILL IN HERE].}
|
9
|
+
gem.homepage = ""
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "text_cleaner"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = TextCleaner::VERSION
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: text_cleaner
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jason Amster
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-09-20 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Simple gem does one thing, and one thing only... Turns funky chars such
|
15
|
+
as [FILL IN HERE] to the proper HTML Encodings such as [FILL IN HERE].
|
16
|
+
email:
|
17
|
+
- jayamster@gmail.com
|
18
|
+
executables: []
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- .gitignore
|
23
|
+
- Gemfile
|
24
|
+
- LICENSE
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- lib/text_cleaner.rb
|
28
|
+
- lib/text_cleaner/version.rb
|
29
|
+
- text_cleaner.gemspec
|
30
|
+
homepage: ''
|
31
|
+
licenses: []
|
32
|
+
post_install_message:
|
33
|
+
rdoc_options: []
|
34
|
+
require_paths:
|
35
|
+
- lib
|
36
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
requirements: []
|
49
|
+
rubyforge_project:
|
50
|
+
rubygems_version: 1.8.24
|
51
|
+
signing_key:
|
52
|
+
specification_version: 3
|
53
|
+
summary: Simple gem does one thing, and one thing only... Turns funky chars such as
|
54
|
+
[FILL IN HERE] to the proper HTML Encodings such as [FILL IN HERE].
|
55
|
+
test_files: []
|