diacritics 0.0.1 → 0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -0
- data/README.md +7 -7
- data/TODO.md +7 -0
- data/diacritics.gemspec +2 -2
- data/lib/diacritics.rb +4 -7
- data/lib/diacritics/alphabet.rb +120 -75
- data/lib/diacritics/cases.rb +11 -3
- data/lib/diacritics/string.rb +25 -7
- data/lib/diacritics/version.rb +2 -1
- data/spec/diacritics/cases_spec.rb +0 -249
- data/spec/diacritics/string_spec.rb +285 -18
- data/spec/spec_helper.rb +4 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 301e7f416e2300e377191605ba087260b4e98a53
|
4
|
+
data.tar.gz: 3d2500bf7a4258b6f7f18ff2841d07a58d3e1554
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e7348fdbf03aa2cfb746757a2ae8e1be7e01f7da1665566aa9b30036e2bb63fdffced87e951c2fd89b2458e54e8a8da390326691c6ccca9149e390ac9cdcde4
|
7
|
+
data.tar.gz: 8979c04576485499c28c843947636a78a4a0d6924250af89aaf1c8bc73279c84f85a002e1c8a4f8a4c04bee5c56760b02a4b75862a5a84b1512c6aab9c629ac0
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Diacritics [](http://badge.fury.io/rb/diacritics) [](https://travis-ci.org/fractalsoft/diacritics) [](https://gemnasium.com/fractalsoft/diacritics) [](https://coveralls.io/r/fractalsoft/diacritics)
|
1
|
+
# Diacritics [](http://badge.fury.io/rb/diacritics) [](https://travis-ci.org/fractalsoft/diacritics) [](https://gemnasium.com/fractalsoft/diacritics) [](https://coveralls.io/r/fractalsoft/diacritics) [](http://waffle.io/fractalsoft/diacritics)
|
2
2
|
[](https://coderwall.com/torrocus)
|
3
3
|
|
4
4
|
Diacritics is a gem which support downcase, upcase and permanent link with diacritical characters.
|
@@ -28,17 +28,17 @@ Diacritics::permanent(text)
|
|
28
28
|
You can include methods into String class:
|
29
29
|
|
30
30
|
```ruby
|
31
|
-
|
32
|
-
include Diacritics::String
|
33
|
-
end
|
31
|
+
String.send(:include, Diacritics::String)
|
34
32
|
```
|
35
33
|
|
36
34
|
and use
|
37
35
|
|
38
36
|
```ruby
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
text = "Lorem ipsum"
|
38
|
+
|
39
|
+
text.diacritics
|
40
|
+
text.diacritics
|
41
|
+
text.permanent
|
42
42
|
```
|
43
43
|
|
44
44
|
## Contributing
|
data/TODO.md
ADDED
data/diacritics.gemspec
CHANGED
@@ -7,9 +7,9 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "diacritics"
|
8
8
|
spec.version = Diacritics::VERSION
|
9
9
|
spec.authors = ["Aleksander Malaszkiewicz"]
|
10
|
-
spec.email = ["
|
10
|
+
spec.email = ["info@fractalsoft.org"]
|
11
11
|
spec.summary = %q{Support diacritics}
|
12
|
-
spec.homepage = ""
|
12
|
+
spec.homepage = "https://github.com/fractalsoft/diacritics"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
15
15
|
spec.files = `git ls-files`.split($/)
|
data/lib/diacritics.rb
CHANGED
@@ -1,7 +1,4 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
|
6
|
-
module Diacritics
|
7
|
-
end
|
1
|
+
require 'diacritics/alphabet'
|
2
|
+
require 'diacritics/cases'
|
3
|
+
require 'diacritics/string'
|
4
|
+
require 'diacritics/version'
|
data/lib/diacritics/alphabet.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
|
3
|
+
# Diacritics private class
|
2
4
|
module Diacritics
|
5
|
+
|
3
6
|
private
|
7
|
+
|
4
8
|
# Characters from many alphabets
|
5
9
|
class Alphabet
|
6
10
|
attr_reader :regexp, :hash
|
@@ -12,6 +16,7 @@ module Diacritics
|
|
12
16
|
end
|
13
17
|
|
14
18
|
private
|
19
|
+
|
15
20
|
def prepare_alphabet
|
16
21
|
data.each_pair do |language, hash|
|
17
22
|
@downcase += hash[:downcase]
|
@@ -53,84 +58,124 @@ module Diacritics
|
|
53
58
|
|
54
59
|
def data
|
55
60
|
{
|
56
|
-
en:
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
61
|
+
en: en, de: de, pl: pl, cs: cs, fr: fr, it: it, eo: eo,
|
62
|
+
is: is, pt: pt, sp: sp, hu: hu, nn: nn, ru: ru, gr: gr
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
def en
|
67
|
+
{ # English
|
68
|
+
downcase: [' ', '?', '.', ','],
|
69
|
+
upcase: [' ', '?', '.', ','],
|
70
|
+
permanent: ['-', '', '', ''],
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
def de
|
75
|
+
{ # German
|
76
|
+
downcase: %w[ä ö ü ß],
|
77
|
+
upcase: %w[Ä Ö Ü ẞ],
|
78
|
+
permanent: %w[ae oe ue ss]
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
82
|
+
def pl
|
83
|
+
{ # Polish
|
84
|
+
downcase: %w[ą ć ę ł ń ó ś ż ź],
|
85
|
+
upcase: %w[Ą Ć Ę Ł Ń Ó Ś Ż Ź],
|
86
|
+
permanent: %w[a c e l n o s z z]
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
90
|
+
def cs
|
91
|
+
{ # Czech
|
72
92
|
downcase: %w[á č í ř š ý ž],
|
73
93
|
upcase: %w[Á Č Í Ř Š Ý Ž],
|
74
94
|
permanent: %w[a c i r s y z]
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
95
|
+
}
|
96
|
+
end
|
97
|
+
|
98
|
+
def fr
|
99
|
+
{ # French
|
100
|
+
downcase: %w[à é è ê ô],
|
101
|
+
upcase: %w[À É È Ê Ô],
|
102
|
+
permanent: %w[a e e e o]
|
103
|
+
}
|
104
|
+
end
|
105
|
+
|
106
|
+
def it
|
107
|
+
{ # Italian
|
108
|
+
downcase: %w[ì ù ò],
|
109
|
+
upcase: %w[Ì Ù Ò],
|
110
|
+
permanent: %w[i u o]
|
111
|
+
}
|
112
|
+
end
|
113
|
+
|
114
|
+
def eo
|
115
|
+
{ # Esperanto
|
116
|
+
downcase: %w[ĉ ĝ ĥ ĵ ŝ ŭ],
|
117
|
+
upcase: %w[Ĉ Ĝ Ĥ Ĵ Ŝ Ŭ],
|
118
|
+
permanent: %w[c g h j s u]
|
119
|
+
}
|
120
|
+
end
|
121
|
+
|
122
|
+
def is
|
123
|
+
{ # Iceland
|
124
|
+
downcase: %w[ð þ],
|
125
|
+
upcase: %w[Ð Þ],
|
126
|
+
permanent: %w[d p]
|
127
|
+
}
|
128
|
+
end
|
129
|
+
|
130
|
+
def pt
|
131
|
+
{ # Portugal
|
132
|
+
downcase: %w[ã ç],
|
133
|
+
upcase: %w[Ã Ç],
|
134
|
+
permanent: %w[a c]
|
135
|
+
}
|
136
|
+
end
|
137
|
+
|
138
|
+
def sp
|
139
|
+
{ # Spanish
|
140
|
+
downcase: ['¿'],
|
141
|
+
upcase: ['¿'],
|
142
|
+
permanent: ['']
|
143
|
+
}
|
144
|
+
end
|
145
|
+
|
146
|
+
def hu
|
147
|
+
{ # Hungarian
|
148
|
+
downcase: %w[ő],
|
149
|
+
upcase: %w[Ő],
|
150
|
+
permanent: %w[oe]
|
151
|
+
}
|
152
|
+
end
|
153
|
+
|
154
|
+
def nn
|
155
|
+
{ # Norwegian
|
156
|
+
downcase: %w[æ å],
|
157
|
+
upcase: %w[Æ Å],
|
158
|
+
permanent: %w[ae a]
|
159
|
+
}
|
160
|
+
end
|
161
|
+
|
162
|
+
def ru
|
163
|
+
{ # Russian
|
164
|
+
downcase: %w[
|
165
|
+
а б в г д е ё ж з и й к л м н о п р с т у ф х ц ч ш ы ь ю я],
|
166
|
+
upcase: %w[
|
167
|
+
А Б В Г Д Е Ё Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Ы Ь Ю Я],
|
168
|
+
permanent: %w[
|
169
|
+
а б в г д е ё ж з и й к л м н о п р с т у ф х ц ч ш ы ь ю я]
|
170
|
+
}
|
171
|
+
end
|
172
|
+
|
173
|
+
def gr
|
174
|
+
{ # Greek
|
175
|
+
downcase: %w[α ά γ δ ε έ ζ η θ ι ί κ λ μ ν ξ ο ό π ρ σ τ υ φ ψ],
|
176
|
+
upcase: %w[Α Ά Γ Δ Ε Έ Ζ Η Θ Ι Ί Κ Λ Μ Ν Ξ Ο Ό Π Ρ Σ Τ Υ Φ Ψ],
|
177
|
+
permanent: %w[
|
178
|
+
a a g d e e z e th i i k l m n x o o p r s t y ph ps]
|
134
179
|
}
|
135
180
|
end
|
136
181
|
end
|
data/lib/diacritics/cases.rb
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
|
3
|
+
# String core class
|
4
|
+
class String
|
5
|
+
alias_method :old_downcase, :downcase
|
6
|
+
alias_method :old_upcase, :upcase
|
7
|
+
end
|
8
|
+
|
9
|
+
# Diacritics classes
|
2
10
|
module Diacritics
|
3
11
|
# Downcase or upcase with diacritics support
|
4
12
|
class Cases
|
@@ -12,15 +20,15 @@ module Diacritics
|
|
12
20
|
end
|
13
21
|
|
14
22
|
def downcase(text)
|
15
|
-
text.
|
23
|
+
text.old_downcase.gsub @regexp[:downcase], @hash[:downcase]
|
16
24
|
end
|
17
25
|
|
18
26
|
def upcase(text)
|
19
|
-
text.
|
27
|
+
text.old_upcase.gsub @regexp[:upcase], @hash[:upcase]
|
20
28
|
end
|
21
29
|
|
22
30
|
def permanent(text)
|
23
|
-
text.
|
31
|
+
text.old_downcase.gsub @regexp[:permanent], @hash[:permanent]
|
24
32
|
end
|
25
33
|
end
|
26
34
|
end
|
data/lib/diacritics/string.rb
CHANGED
@@ -1,20 +1,38 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
class String
|
3
|
-
alias_method :old_downcase, :downcase
|
4
|
-
alias_method :old_upcase, :upcase
|
5
|
-
end
|
6
|
-
|
7
2
|
module Diacritics
|
3
|
+
# Include this into String class
|
8
4
|
module String
|
5
|
+
# @deprecated Please use {#downcase} instead.
|
9
6
|
def diacritics_downcase
|
10
|
-
|
7
|
+
warn '[DEPRECATION] `diacritics_downcase` is depraceted. Please use `downcase` instead.'
|
8
|
+
send :downcase
|
11
9
|
end
|
12
10
|
|
11
|
+
# @deprecated Please use {#upcase} instead.
|
13
12
|
def diacritics_upcase
|
14
|
-
|
13
|
+
warn '[DEPRECATION] `diacritics_upcase` is depraceted. Please use `upcase` instead.'
|
14
|
+
send :upcase
|
15
15
|
end
|
16
16
|
|
17
|
+
# @deprecated Please use {#permanent} instead.
|
17
18
|
def permanent_link
|
19
|
+
warn '[DEPRECATION] `permanent_link` is depraceted. Please use `permanent` instead.'
|
20
|
+
send :permanent
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.included(klass)
|
24
|
+
klass.class_eval do
|
25
|
+
def downcase
|
26
|
+
Diacritics::Cases.instance.downcase self
|
27
|
+
end
|
28
|
+
|
29
|
+
def upcase
|
30
|
+
Diacritics::Cases.instance.upcase self
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def permanent
|
18
36
|
Diacritics::Cases.instance.permanent self
|
19
37
|
end
|
20
38
|
end
|
data/lib/diacritics/version.rb
CHANGED
@@ -2,253 +2,4 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
describe Diacritics::Cases do
|
5
|
-
context "#downcase, #upcase, #permanent" do
|
6
|
-
subject { Diacritics::Cases.instance }
|
7
|
-
|
8
|
-
[
|
9
|
-
{ # English
|
10
|
-
text: "Will will Will will Will's will to Will?",
|
11
|
-
lower: "will will will will will's will to will?",
|
12
|
-
upper: "WILL WILL WILL WILL WILL'S WILL TO WILL?",
|
13
|
-
permanent: "will-will-will-will-will's-will-to-will"
|
14
|
-
},
|
15
|
-
{ # German
|
16
|
-
text: "Acht alte Ameisen aßen am Abend Ananas.",
|
17
|
-
lower: "acht alte ameisen aßen am abend ananas.",
|
18
|
-
upper: "ACHT ALTE AMEISEN AẞEN AM ABEND ANANAS.",
|
19
|
-
permanent: "acht-alte-ameisen-assen-am-abend-ananas",
|
20
|
-
},
|
21
|
-
{ # German
|
22
|
-
text: "Hämmer Hämmer? Hämmer hämmer.",
|
23
|
-
lower: "hämmer hämmer? hämmer hämmer.",
|
24
|
-
upper: "HÄMMER HÄMMER? HÄMMER HÄMMER.",
|
25
|
-
permanent: "haemmer-haemmer-haemmer-haemmer",
|
26
|
-
},
|
27
|
-
{ # German
|
28
|
-
text: "Fünf Ferkel fressen frisches Futter.",
|
29
|
-
lower: "fünf ferkel fressen frisches futter.",
|
30
|
-
upper: "FÜNF FERKEL FRESSEN FRISCHES FUTTER.",
|
31
|
-
permanent: "fuenf-ferkel-fressen-frisches-futter",
|
32
|
-
},
|
33
|
-
{
|
34
|
-
text: "Ödögidöggi",
|
35
|
-
lower: "ödögidöggi",
|
36
|
-
upper: "ÖDÖGIDÖGGI",
|
37
|
-
permanent: "oedoegidoeggi",
|
38
|
-
},
|
39
|
-
{ # Polish
|
40
|
-
text: "Ćma ćmę ćmi.",
|
41
|
-
lower: "ćma ćmę ćmi.",
|
42
|
-
upper: "ĆMA ĆMĘ ĆMI.",
|
43
|
-
permanent: "cma-cme-cmi",
|
44
|
-
},
|
45
|
-
{ # Polish
|
46
|
-
text: "Żubr żuł żuchwą żurawinę.",
|
47
|
-
lower: "żubr żuł żuchwą żurawinę.",
|
48
|
-
upper: "ŻUBR ŻUŁ ŻUCHWĄ ŻURAWINĘ.",
|
49
|
-
permanent: "zubr-zul-zuchwa-zurawine",
|
50
|
-
},
|
51
|
-
{ # Polish
|
52
|
-
text: "Pchnąć w tę łódź jeża lub ośm skrzyń fig.",
|
53
|
-
lower: "pchnąć w tę łódź jeża lub ośm skrzyń fig.",
|
54
|
-
upper: "PCHNĄĆ W TĘ ŁÓDŹ JEŻA LUB OŚM SKRZYŃ FIG.",
|
55
|
-
permanent: "pchnac-w-te-lodz-jeza-lub-osm-skrzyn-fig",
|
56
|
-
},
|
57
|
-
{ # Czech
|
58
|
-
text: "Čistý s Čistou čistili činčilový čepec.",
|
59
|
-
lower: "čistý s čistou čistili činčilový čepec.",
|
60
|
-
upper: "ČISTÝ S ČISTOU ČISTILI ČINČILOVÝ ČEPEC.",
|
61
|
-
permanent: "cisty-s-cistou-cistili-cincilovy-cepec",
|
62
|
-
},
|
63
|
-
{ # Czech
|
64
|
-
text: "Řekni řeřicha.",
|
65
|
-
lower: "řekni řeřicha.",
|
66
|
-
upper: "ŘEKNI ŘEŘICHA.",
|
67
|
-
permanent: "rekni-rericha",
|
68
|
-
},
|
69
|
-
{ # Polish
|
70
|
-
text: "Zażółć gęślą jaźń",
|
71
|
-
lower: "zażółć gęślą jaźń",
|
72
|
-
upper: "ZAŻÓŁĆ GĘŚLĄ JAŹŃ",
|
73
|
-
permanent: "zazolc-gesla-jazn",
|
74
|
-
},
|
75
|
-
{
|
76
|
-
text: "À l’époque de la conquête de la Gaule par les armées",
|
77
|
-
lower: "à l’époque de la conquête de la gaule par les armées",
|
78
|
-
upper: "À L’ÉPOQUE DE LA CONQUÊTE DE LA GAULE PAR LES ARMÉES",
|
79
|
-
permanent: "a-l’epoque-de-la-conquete-de-la-gaule-par-les-armees",
|
80
|
-
},
|
81
|
-
{
|
82
|
-
text: "Zalyžařivší si lyžař potkal nezalyžařivšího si lyžaře.",
|
83
|
-
lower: "zalyžařivší si lyžař potkal nezalyžařivšího si lyžaře.",
|
84
|
-
upper: "ZALYŽAŘIVŠÍ SI LYŽAŘ POTKAL NEZALYŽAŘIVŠÍHO SI LYŽAŘE.",
|
85
|
-
permanent: "zalyzarivsi-si-lyzar-potkal-nezalyzarivsiho-si-lyzare",
|
86
|
-
},
|
87
|
-
{
|
88
|
-
text: "Náš pan kaplan v kapli plakal.",
|
89
|
-
lower: "náš pan kaplan v kapli plakal.",
|
90
|
-
upper: "NÁŠ PAN KAPLAN V KAPLI PLAKAL.",
|
91
|
-
permanent: "nas-pan-kaplan-v-kapli-plakal",
|
92
|
-
},
|
93
|
-
{
|
94
|
-
text: "¿Quién lo desenladrillará?",
|
95
|
-
lower: "¿quién lo desenladrillará?",
|
96
|
-
upper: "¿QUIÉN LO DESENLADRILLARÁ?",
|
97
|
-
permanent: "quien-lo-desenladrillara",
|
98
|
-
},
|
99
|
-
{
|
100
|
-
text: "clavó un clavito Pablito.",
|
101
|
-
lower: "clavó un clavito pablito.",
|
102
|
-
upper: "CLAVÓ UN CLAVITO PABLITO.",
|
103
|
-
permanent: "clavo-un-clavito-pablito",
|
104
|
-
},
|
105
|
-
{
|
106
|
-
text: "In Perù però perì.",
|
107
|
-
lower: "in perù però perì.",
|
108
|
-
upper: "IN PERÙ PERÒ PERÌ.",
|
109
|
-
permanent: "in-peru-pero-peri",
|
110
|
-
},
|
111
|
-
{
|
112
|
-
text: "Ĉu ŝi ĉiam ĉe ĉio ruĝiĝas?",
|
113
|
-
lower: "ĉu ŝi ĉiam ĉe ĉio ruĝiĝas?",
|
114
|
-
upper: "ĈU ŜI ĈIAM ĈE ĈIO RUĜIĜAS?",
|
115
|
-
permanent: "cu-si-ciam-ce-cio-rugigas",
|
116
|
-
},
|
117
|
-
{
|
118
|
-
text: "Eĥoŝanĝo ĉiu-ĵaŭde.",
|
119
|
-
lower: "eĥoŝanĝo ĉiu-ĵaŭde.",
|
120
|
-
upper: "EĤOŜANĜO ĈIU-ĴAŬDE.",
|
121
|
-
permanent: "ehosango-ciu-jaude",
|
122
|
-
},
|
123
|
-
{
|
124
|
-
text: "Árni á Á á á á beit (við á).",
|
125
|
-
lower: "árni á á á á á beit (við á).",
|
126
|
-
upper: "ÁRNI Á Á Á Á Á BEIT (VIÐ Á).",
|
127
|
-
permanent: "arni-a-a-a-a-a-beit-(vid-a)",
|
128
|
-
},
|
129
|
-
{
|
130
|
-
text: "Það fer að verða verra ferðaveðrið",
|
131
|
-
lower: "það fer að verða verra ferðaveðrið",
|
132
|
-
upper: "ÞAÐ FER AÐ VERÐA VERRA FERÐAVEÐRIÐ",
|
133
|
-
permanent: "pad-fer-ad-verda-verra-ferdavedrid",
|
134
|
-
},
|
135
|
-
{
|
136
|
-
text: "Четыре чёрненьких чумазеньких чертёнка",
|
137
|
-
lower: "четыре чёрненьких чумазеньких чертёнка",
|
138
|
-
upper: "ЧЕТЫРЕ ЧЁРНЕНЬКИХ ЧУМАЗЕНЬКИХ ЧЕРТЁНКА",
|
139
|
-
permanent: "четыре-чёрненьких-чумазеньких-чертёнка",
|
140
|
-
},
|
141
|
-
{
|
142
|
-
text: "чертили чёрными чернилами чертёж.",
|
143
|
-
lower: "чертили чёрными чернилами чертёж.",
|
144
|
-
upper: "ЧЕРТИЛИ ЧЁРНЫМИ ЧЕРНИЛАМИ ЧЕРТЁЖ.",
|
145
|
-
permanent: "чертили-чёрными-чернилами-чертёж",
|
146
|
-
},
|
147
|
-
{
|
148
|
-
text: "Чайные чашки в печали, скучая, бренча закричали.",
|
149
|
-
lower: "чайные чашки в печали, скучая, бренча закричали.",
|
150
|
-
upper: "ЧАЙНЫЕ ЧАШКИ В ПЕЧАЛИ, СКУЧАЯ, БРЕНЧА ЗАКРИЧАЛИ.",
|
151
|
-
permanent: "чайные-чашки-в-печали-скучая-бренча-закричали",
|
152
|
-
},
|
153
|
-
{
|
154
|
-
text: "Недопереквалифицировавшийся.",
|
155
|
-
lower: "недопереквалифицировавшийся.",
|
156
|
-
upper: "НЕДОПЕРЕКВАЛИФИЦИРОВАВШИЙСЯ.",
|
157
|
-
permanent: "недопереквалифицировавшийся",
|
158
|
-
},
|
159
|
-
{
|
160
|
-
text: "Как в капюшоне он смешон",
|
161
|
-
lower: "как в капюшоне он смешон",
|
162
|
-
upper: "КАК В КАПЮШОНЕ ОН СМЕШОН",
|
163
|
-
permanent: "как-в-капюшоне-он-смешон",
|
164
|
-
},
|
165
|
-
{
|
166
|
-
text: "Стоит гора посреди двора.",
|
167
|
-
lower: "стоит гора посреди двора.",
|
168
|
-
upper: "СТОИТ ГОРА ПОСРЕДИ ДВОРА.",
|
169
|
-
permanent: "стоит-гора-посреди-двора",
|
170
|
-
},
|
171
|
-
{
|
172
|
-
text: "Μια τίγρη με τρία τιγράκια.",
|
173
|
-
lower: "μια τίγρη με τρία τιγράκια.",
|
174
|
-
upper: "ΜΙΑ ΤΊΓΡΗ ΜΕ ΤΡΊΑ ΤΙΓΡΆΚΙΑ.",
|
175
|
-
permanent: "mia-tigre-me-tria-tigrakia",
|
176
|
-
},
|
177
|
-
{
|
178
|
-
text: "Το ξίδι του Ξέρξη ξίδιασε",
|
179
|
-
lower: "το ξίδι του ξέρξη ξίδιασε",
|
180
|
-
upper: "ΤΟ ΞΊΔΙ ΤΟΥ ΞΈΡΞΗ ΞΊΔΙΑΣΕ",
|
181
|
-
permanent: "to-xidi-toy-xerxe-xidiase",
|
182
|
-
},
|
183
|
-
{
|
184
|
-
text: "Πίτα σπανακόπιτα σπανακολαδοφραγκοσυκοπαντζαροκολοκυθόπιτα.",
|
185
|
-
lower: "πίτα σπανακόπιτα σπανακολαδοφραγκοσυκοπαντζαροκολοκυθόπιτα.",
|
186
|
-
upper: "ΠΊΤΑ ΣΠΑΝΑΚΌΠΙΤΑ ΣΠΑΝΑΚΟΛΑΔΟΦΡΑΓΚΟΣΥΚΟΠΑΝΤΖΑΡΟΚΟΛΟΚΥΘΌΠΙΤΑ.",
|
187
|
-
permanent:
|
188
|
-
"pita-spanakopita-spanakoladophragkosykopantzarokolokythopita",
|
189
|
-
},
|
190
|
-
{
|
191
|
-
text: "Κοράλι ψιλοκόραλο και ψιλοκοραλάκι.",
|
192
|
-
lower: "κοράλι ψιλοκόραλο και ψιλοκοραλάκι.",
|
193
|
-
upper: "ΚΟΡΆΛΙ ΨΙΛΟΚΌΡΑΛΟ ΚΑΙ ΨΙΛΟΚΟΡΑΛΆΚΙ.",
|
194
|
-
permanent: "korali-psilokoralo-kai-psilokoralaki",
|
195
|
-
},
|
196
|
-
{
|
197
|
-
text: "É muito socó para um socó só coçar.",
|
198
|
-
lower: "é muito socó para um socó só coçar.",
|
199
|
-
upper: "É MUITO SOCÓ PARA UM SOCÓ SÓ COÇAR.",
|
200
|
-
permanent: "e-muito-soco-para-um-soco-so-cocar",
|
201
|
-
},
|
202
|
-
{
|
203
|
-
text: "Mon père est maire, mon frère est masseur.",
|
204
|
-
lower: "mon père est maire, mon frère est masseur.",
|
205
|
-
upper: "MON PÈRE EST MAIRE, MON FRÈRE EST MASSEUR.",
|
206
|
-
permanent: "mon-pere-est-maire-mon-frere-est-masseur",
|
207
|
-
},
|
208
|
-
{
|
209
|
-
text: "Se não percebeste,",
|
210
|
-
lower: "se não percebeste,",
|
211
|
-
upper: "SE NÃO PERCEBESTE,",
|
212
|
-
permanent: "se-nao-percebeste",
|
213
|
-
},
|
214
|
-
{
|
215
|
-
text: "rôt tenta chat",
|
216
|
-
lower: "rôt tenta chat",
|
217
|
-
upper: "RÔT TENTA CHAT",
|
218
|
-
permanent: "rot-tenta-chat",
|
219
|
-
},
|
220
|
-
{
|
221
|
-
text: "Nyelvtörők",
|
222
|
-
lower: "nyelvtörők",
|
223
|
-
upper: "NYELVTÖRŐK",
|
224
|
-
permanent: "nyelvtoeroek",
|
225
|
-
},
|
226
|
-
{
|
227
|
-
text: "Ein hælv kælv låg i elva og flaut på ein sælapinne.",
|
228
|
-
lower: "ein hælv kælv låg i elva og flaut på ein sælapinne.",
|
229
|
-
upper: "EIN HÆLV KÆLV LÅG I ELVA OG FLAUT PÅ EIN SÆLAPINNE.",
|
230
|
-
permanent: "ein-haelv-kaelv-lag-i-elva-og-flaut-pa-ein-saelapinne",
|
231
|
-
},
|
232
|
-
# {
|
233
|
-
# text: "",
|
234
|
-
# lower: "",
|
235
|
-
# upper: "",
|
236
|
-
# permanent: "",
|
237
|
-
# },
|
238
|
-
].each do |item|
|
239
|
-
text, lower, upper, permanent = item.values
|
240
|
-
|
241
|
-
it "change '#{text}' to lowercase" do
|
242
|
-
subject.downcase(text).should eq(lower)
|
243
|
-
end
|
244
|
-
|
245
|
-
it "change '#{text}' to uppercase" do
|
246
|
-
subject.upcase(text).should eq(upper)
|
247
|
-
end
|
248
|
-
|
249
|
-
it "change '#{text}' to permanent" do
|
250
|
-
subject.permanent(text).should eq(permanent)
|
251
|
-
end
|
252
|
-
end
|
253
|
-
end
|
254
5
|
end
|
@@ -2,34 +2,301 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
describe Diacritics::String do
|
5
|
-
|
6
|
-
|
5
|
+
String.send(:include, Diacritics::String)
|
6
|
+
|
7
|
+
context 'English' do
|
8
|
+
subject { "Will will Will will Will's will to Will?" }
|
9
|
+
its(:downcase) { should eq "will will will will will's will to will?" }
|
10
|
+
its(:upcase) { should eq "WILL WILL WILL WILL WILL'S WILL TO WILL?" }
|
11
|
+
its(:permanent) { should eq "will-will-will-will-will's-will-to-will" }
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'German' do
|
15
|
+
subject { 'Acht alte Ameisen aßen am Abend Ananas.' }
|
16
|
+
its(:downcase) { should eq 'acht alte ameisen aßen am abend ananas.' }
|
17
|
+
its(:upcase) { should eq 'ACHT ALTE AMEISEN AẞEN AM ABEND ANANAS.' }
|
18
|
+
its(:permanent) { should eq 'acht-alte-ameisen-assen-am-abend-ananas' }
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'German' do
|
22
|
+
subject { 'Hämmer Hämmer? Hämmer hämmer.' }
|
23
|
+
its(:downcase) { should eq 'hämmer hämmer? hämmer hämmer.' }
|
24
|
+
its(:upcase) { should eq 'HÄMMER HÄMMER? HÄMMER HÄMMER.' }
|
25
|
+
its(:permanent) { should eq 'haemmer-haemmer-haemmer-haemmer' }
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'German' do
|
29
|
+
subject { 'Fünf Ferkel fressen frisches Futter.' }
|
30
|
+
its(:downcase) { should eq 'fünf ferkel fressen frisches futter.' }
|
31
|
+
its(:upcase) { should eq 'FÜNF FERKEL FRESSEN FRISCHES FUTTER.' }
|
32
|
+
its(:permanent) { should eq 'fuenf-ferkel-fressen-frisches-futter' }
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'German' do
|
36
|
+
subject { 'Ödögidöggi' }
|
37
|
+
its(:downcase) { should eq 'ödögidöggi' }
|
38
|
+
its(:upcase) { should eq 'ÖDÖGIDÖGGI' }
|
39
|
+
its(:permanent) { should eq 'oedoegidoeggi' }
|
40
|
+
end
|
41
|
+
|
42
|
+
context 'Polish' do
|
43
|
+
subject { 'Ćma ćmę ćmi.' }
|
44
|
+
its(:downcase) { should eq 'ćma ćmę ćmi.' }
|
45
|
+
its(:upcase) { should eq 'ĆMA ĆMĘ ĆMI.' }
|
46
|
+
its(:permanent) { should eq 'cma-cme-cmi' }
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'Polish' do
|
50
|
+
subject { 'Żubr żuł żuchwą żurawinę.' }
|
51
|
+
its(:downcase) { should eq 'żubr żuł żuchwą żurawinę.' }
|
52
|
+
its(:upcase) { should eq 'ŻUBR ŻUŁ ŻUCHWĄ ŻURAWINĘ.' }
|
53
|
+
its(:permanent) { should eq 'zubr-zul-zuchwa-zurawine' }
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'Polish' do
|
57
|
+
subject { 'Pchnąć w tę łódź jeża lub ośm skrzyń fig.' }
|
58
|
+
its(:downcase) { should eq 'pchnąć w tę łódź jeża lub ośm skrzyń fig.' }
|
59
|
+
its(:upcase) { should eq 'PCHNĄĆ W TĘ ŁÓDŹ JEŻA LUB OŚM SKRZYŃ FIG.' }
|
60
|
+
its(:permanent) { should eq 'pchnac-w-te-lodz-jeza-lub-osm-skrzyn-fig' }
|
61
|
+
end
|
62
|
+
|
63
|
+
context 'Czech' do
|
64
|
+
subject { 'Čistý s Čistou čistili činčilový čepec.' }
|
65
|
+
its(:downcase) { should eq 'čistý s čistou čistili činčilový čepec.' }
|
66
|
+
its(:upcase) { should eq 'ČISTÝ S ČISTOU ČISTILI ČINČILOVÝ ČEPEC.' }
|
67
|
+
its(:permanent) { should eq 'cisty-s-cistou-cistili-cincilovy-cepec' }
|
68
|
+
end
|
69
|
+
|
70
|
+
context 'Czech' do
|
71
|
+
subject { 'Řekni řeřicha.' }
|
72
|
+
its(:downcase) { should eq 'řekni řeřicha.' }
|
73
|
+
its(:upcase) { should eq 'ŘEKNI ŘEŘICHA.' }
|
74
|
+
its(:permanent) { should eq 'rekni-rericha' }
|
75
|
+
end
|
76
|
+
|
77
|
+
context 'Polish' do
|
78
|
+
subject { 'Zażółć gęślą jaźń' }
|
79
|
+
its(:downcase) { should eq 'zażółć gęślą jaźń' }
|
80
|
+
its(:upcase) { should eq 'ZAŻÓŁĆ GĘŚLĄ JAŹŃ' }
|
81
|
+
its(:permanent) { should eq 'zazolc-gesla-jazn' }
|
82
|
+
end
|
83
|
+
|
84
|
+
context do
|
85
|
+
subject { 'À l’époque de la conquête de la Gaule par les armées' }
|
86
|
+
its(:downcase) do
|
87
|
+
should eq 'à l’époque de la conquête de la gaule par les armées'
|
88
|
+
end
|
89
|
+
its(:upcase) do
|
90
|
+
should eq 'À L’ÉPOQUE DE LA CONQUÊTE DE LA GAULE PAR LES ARMÉES'
|
91
|
+
end
|
92
|
+
its(:permanent) do
|
93
|
+
should eq 'a-l’epoque-de-la-conquete-de-la-gaule-par-les-armees'
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
context do
|
98
|
+
subject { 'Zalyžařivší si lyžař potkal nezalyžařivšího si lyžaře.' }
|
99
|
+
its(:downcase) do
|
100
|
+
should eq 'zalyžařivší si lyžař potkal nezalyžařivšího si lyžaře.'
|
101
|
+
end
|
102
|
+
its(:upcase) do
|
103
|
+
should eq 'ZALYŽAŘIVŠÍ SI LYŽAŘ POTKAL NEZALYŽAŘIVŠÍHO SI LYŽAŘE.'
|
104
|
+
end
|
105
|
+
its(:permanent) do
|
106
|
+
should eq 'zalyzarivsi-si-lyzar-potkal-nezalyzarivsiho-si-lyzare'
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
context do
|
111
|
+
subject { 'Náš pan kaplan v kapli plakal.' }
|
112
|
+
its(:downcase) { should eq 'náš pan kaplan v kapli plakal.' }
|
113
|
+
its(:upcase) { should eq 'NÁŠ PAN KAPLAN V KAPLI PLAKAL.' }
|
114
|
+
its(:permanent) { should eq 'nas-pan-kaplan-v-kapli-plakal' }
|
115
|
+
end
|
116
|
+
|
117
|
+
context do
|
118
|
+
subject { '¿Quién lo desenladrillará?' }
|
119
|
+
its(:downcase) { should eq '¿quién lo desenladrillará?' }
|
120
|
+
its(:upcase) { should eq '¿QUIÉN LO DESENLADRILLARÁ?' }
|
121
|
+
its(:permanent) { should eq 'quien-lo-desenladrillara' }
|
122
|
+
end
|
123
|
+
|
124
|
+
context do
|
125
|
+
subject { 'clavó un clavito Pablito.' }
|
126
|
+
its(:downcase) { should eq 'clavó un clavito pablito.' }
|
127
|
+
its(:upcase) { should eq 'CLAVÓ UN CLAVITO PABLITO.' }
|
128
|
+
its(:permanent) { should eq 'clavo-un-clavito-pablito' }
|
129
|
+
end
|
130
|
+
|
131
|
+
context do
|
132
|
+
subject { 'In Perù però perì.' }
|
133
|
+
its(:downcase) { should eq 'in perù però perì.' }
|
134
|
+
its(:upcase) { should eq 'IN PERÙ PERÒ PERÌ.' }
|
135
|
+
its(:permanent) { should eq 'in-peru-pero-peri' }
|
7
136
|
end
|
8
137
|
|
9
|
-
context
|
10
|
-
|
11
|
-
|
12
|
-
|
138
|
+
context do
|
139
|
+
subject { 'Ĉu ŝi ĉiam ĉe ĉio ruĝiĝas?' }
|
140
|
+
its(:downcase) { should eq 'ĉu ŝi ĉiam ĉe ĉio ruĝiĝas?' }
|
141
|
+
its(:upcase) { should eq 'ĈU ŜI ĈIAM ĈE ĈIO RUĜIĜAS?' }
|
142
|
+
its(:permanent) { should eq 'cu-si-ciam-ce-cio-rugigas' }
|
143
|
+
end
|
144
|
+
|
145
|
+
context do
|
146
|
+
subject { 'Eĥoŝanĝo ĉiu-ĵaŭde.' }
|
147
|
+
its(:downcase) { should eq 'eĥoŝanĝo ĉiu-ĵaŭde.' }
|
148
|
+
its(:upcase) { should eq 'EĤOŜANĜO ĈIU-ĴAŬDE.' }
|
149
|
+
its(:permanent) { should eq 'ehosango-ciu-jaude' }
|
150
|
+
end
|
151
|
+
|
152
|
+
context do
|
153
|
+
subject { 'Árni á Á á á á beit (við á).' }
|
154
|
+
its(:downcase) { should eq 'árni á á á á á beit (við á).' }
|
155
|
+
its(:upcase) { should eq 'ÁRNI Á Á Á Á Á BEIT (VIÐ Á).' }
|
156
|
+
its(:permanent) { should eq 'arni-a-a-a-a-a-beit-(vid-a)' }
|
157
|
+
end
|
158
|
+
|
159
|
+
context do
|
160
|
+
subject { 'Það fer að verða verra ferðaveðrið' }
|
161
|
+
its(:downcase) { should eq 'það fer að verða verra ferðaveðrið' }
|
162
|
+
its(:upcase) { should eq 'ÞAÐ FER AÐ VERÐA VERRA FERÐAVEÐRIÐ' }
|
163
|
+
its(:permanent) { should eq 'pad-fer-ad-verda-verra-ferdavedrid' }
|
164
|
+
end
|
165
|
+
|
166
|
+
context do
|
167
|
+
subject { 'Четыре чёрненьких чумазеньких чертёнка' }
|
168
|
+
its(:downcase) { should eq 'четыре чёрненьких чумазеньких чертёнка' }
|
169
|
+
its(:upcase) { should eq 'ЧЕТЫРЕ ЧЁРНЕНЬКИХ ЧУМАЗЕНЬКИХ ЧЕРТЁНКА' }
|
170
|
+
its(:permanent) { should eq 'четыре-чёрненьких-чумазеньких-чертёнка' }
|
171
|
+
end
|
172
|
+
|
173
|
+
context do
|
174
|
+
subject { 'чертили чёрными чернилами чертёж.' }
|
175
|
+
its(:downcase) { should eq 'чертили чёрными чернилами чертёж.' }
|
176
|
+
its(:upcase) { should eq 'ЧЕРТИЛИ ЧЁРНЫМИ ЧЕРНИЛАМИ ЧЕРТЁЖ.' }
|
177
|
+
its(:permanent) { should eq 'чертили-чёрными-чернилами-чертёж' }
|
178
|
+
end
|
13
179
|
|
14
|
-
|
180
|
+
context do
|
181
|
+
subject { 'Чайные чашки в печали, скучая, бренча закричали.' }
|
182
|
+
its(:downcase) do
|
183
|
+
should eq 'чайные чашки в печали, скучая, бренча закричали.'
|
184
|
+
end
|
185
|
+
its(:upcase) do
|
186
|
+
should eq 'ЧАЙНЫЕ ЧАШКИ В ПЕЧАЛИ, СКУЧАЯ, БРЕНЧА ЗАКРИЧАЛИ.'
|
187
|
+
end
|
188
|
+
its(:permanent) do
|
189
|
+
should eq 'чайные-чашки-в-печали-скучая-бренча-закричали'
|
15
190
|
end
|
16
191
|
end
|
17
192
|
|
18
|
-
context
|
19
|
-
|
20
|
-
|
21
|
-
|
193
|
+
context do
|
194
|
+
subject { 'Недопереквалифицировавшийся.' }
|
195
|
+
its(:downcase) { should eq 'недопереквалифицировавшийся.' }
|
196
|
+
its(:upcase) { should eq 'НЕДОПЕРЕКВАЛИФИЦИРОВАВШИЙСЯ.' }
|
197
|
+
its(:permanent) { should eq 'недопереквалифицировавшийся' }
|
198
|
+
end
|
199
|
+
|
200
|
+
context do
|
201
|
+
subject { 'Как в капюшоне он смешон' }
|
202
|
+
its(:downcase) { should eq 'как в капюшоне он смешон' }
|
203
|
+
its(:upcase) { should eq 'КАК В КАПЮШОНЕ ОН СМЕШОН' }
|
204
|
+
its(:permanent) { should eq 'как-в-капюшоне-он-смешон' }
|
205
|
+
end
|
206
|
+
|
207
|
+
context do
|
208
|
+
subject { 'Стоит гора посреди двора.' }
|
209
|
+
its(:downcase) { should eq 'стоит гора посреди двора.' }
|
210
|
+
its(:upcase) { should eq 'СТОИТ ГОРА ПОСРЕДИ ДВОРА.' }
|
211
|
+
its(:permanent) { should eq 'стоит-гора-посреди-двора' }
|
212
|
+
end
|
213
|
+
|
214
|
+
context do
|
215
|
+
subject { 'Μια τίγρη με τρία τιγράκια.' }
|
216
|
+
its(:downcase) { should eq 'μια τίγρη με τρία τιγράκια.' }
|
217
|
+
its(:upcase) { should eq 'ΜΙΑ ΤΊΓΡΗ ΜΕ ΤΡΊΑ ΤΙΓΡΆΚΙΑ.' }
|
218
|
+
its(:permanent) { should eq 'mia-tigre-me-tria-tigrakia' }
|
219
|
+
end
|
22
220
|
|
23
|
-
|
221
|
+
context do
|
222
|
+
subject { 'Μια τίγρη με τρία τιγράκια.' }
|
223
|
+
its(:downcase) { should eq 'μια τίγρη με τρία τιγράκια.' }
|
224
|
+
its(:upcase) { should eq 'ΜΙΑ ΤΊΓΡΗ ΜΕ ΤΡΊΑ ΤΙΓΡΆΚΙΑ.' }
|
225
|
+
its(:permanent) { should eq 'mia-tigre-me-tria-tigrakia' }
|
226
|
+
end
|
227
|
+
|
228
|
+
context do
|
229
|
+
subject { 'Το ξίδι του Ξέρξη ξίδιασε' }
|
230
|
+
its(:downcase) { should eq 'το ξίδι του ξέρξη ξίδιασε' }
|
231
|
+
its(:upcase) { should eq 'ΤΟ ΞΊΔΙ ΤΟΥ ΞΈΡΞΗ ΞΊΔΙΑΣΕ' }
|
232
|
+
its(:permanent) { should eq 'to-xidi-toy-xerxe-xidiase' }
|
233
|
+
end
|
234
|
+
|
235
|
+
context do
|
236
|
+
subject { 'Πίτα σπανακόπιτα σπανακολαδοφραγκοσυκοπαντζαροκολοκυθόπιτα.' }
|
237
|
+
its(:downcase) do
|
238
|
+
should eq 'πίτα σπανακόπιτα σπανακολαδοφραγκοσυκοπαντζαροκολοκυθόπιτα.'
|
239
|
+
end
|
240
|
+
its(:upcase) do
|
241
|
+
should eq 'ΠΊΤΑ ΣΠΑΝΑΚΌΠΙΤΑ ΣΠΑΝΑΚΟΛΑΔΟΦΡΑΓΚΟΣΥΚΟΠΑΝΤΖΑΡΟΚΟΛΟΚΥΘΌΠΙΤΑ.'
|
242
|
+
end
|
243
|
+
its(:permanent) do
|
244
|
+
should eq 'pita-spanakopita-spanakoladophragkosykopantzarokolokythopita'
|
24
245
|
end
|
25
246
|
end
|
26
247
|
|
27
|
-
context
|
28
|
-
|
29
|
-
|
30
|
-
|
248
|
+
context do
|
249
|
+
subject { 'Κοράλι ψιλοκόραλο και ψιλοκοραλάκι.' }
|
250
|
+
its(:downcase) { should eq 'κοράλι ψιλοκόραλο και ψιλοκοραλάκι.' }
|
251
|
+
its(:upcase) { should eq 'ΚΟΡΆΛΙ ΨΙΛΟΚΌΡΑΛΟ ΚΑΙ ΨΙΛΟΚΟΡΑΛΆΚΙ.' }
|
252
|
+
its(:permanent) { should eq 'korali-psilokoralo-kai-psilokoralaki' }
|
253
|
+
end
|
31
254
|
|
32
|
-
|
255
|
+
context do
|
256
|
+
subject { 'É muito socó para um socó só coçar.' }
|
257
|
+
its(:downcase) { should eq 'é muito socó para um socó só coçar.' }
|
258
|
+
its(:upcase) { should eq 'É MUITO SOCÓ PARA UM SOCÓ SÓ COÇAR.' }
|
259
|
+
its(:permanent) { should eq 'e-muito-soco-para-um-soco-so-cocar' }
|
260
|
+
end
|
261
|
+
|
262
|
+
context do
|
263
|
+
subject { 'Mon père est maire, mon frère est masseur.' }
|
264
|
+
its(:downcase) { should eq 'mon père est maire, mon frère est masseur.' }
|
265
|
+
its(:upcase) { should eq 'MON PÈRE EST MAIRE, MON FRÈRE EST MASSEUR.' }
|
266
|
+
its(:permanent) { should eq 'mon-pere-est-maire-mon-frere-est-masseur' }
|
267
|
+
end
|
268
|
+
|
269
|
+
context do
|
270
|
+
subject { 'Se não percebeste,' }
|
271
|
+
its(:downcase) { should eq 'se não percebeste,' }
|
272
|
+
its(:upcase) { should eq 'SE NÃO PERCEBESTE,' }
|
273
|
+
its(:permanent) { should eq 'se-nao-percebeste' }
|
274
|
+
end
|
275
|
+
|
276
|
+
context do
|
277
|
+
subject { 'rôt tenta chat' }
|
278
|
+
its(:downcase) { should eq 'rôt tenta chat' }
|
279
|
+
its(:upcase) { should eq 'RÔT TENTA CHAT' }
|
280
|
+
its(:permanent) { should eq 'rot-tenta-chat' }
|
281
|
+
end
|
282
|
+
|
283
|
+
context do
|
284
|
+
subject { 'Nyelvtörők' }
|
285
|
+
its(:downcase) { should eq 'nyelvtörők' }
|
286
|
+
its(:upcase) { should eq 'NYELVTÖRŐK' }
|
287
|
+
its(:permanent) { should eq 'nyelvtoeroek' }
|
288
|
+
end
|
289
|
+
|
290
|
+
context do
|
291
|
+
subject { 'Ein hælv kælv låg i elva og flaut på ein sælapinne.' }
|
292
|
+
its(:downcase) do
|
293
|
+
should eq 'ein hælv kælv låg i elva og flaut på ein sælapinne.'
|
294
|
+
end
|
295
|
+
its(:upcase) do
|
296
|
+
should eq 'EIN HÆLV KÆLV LÅG I ELVA OG FLAUT PÅ EIN SÆLAPINNE.'
|
297
|
+
end
|
298
|
+
its(:permanent) do
|
299
|
+
should eq 'ein-haelv-kaelv-lag-i-elva-og-flaut-pa-ein-saelapinne'
|
33
300
|
end
|
34
301
|
end
|
35
|
-
end
|
302
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diacritics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksander Malaszkiewicz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
version: '0'
|
41
41
|
description:
|
42
42
|
email:
|
43
|
-
-
|
43
|
+
- info@fractalsoft.org
|
44
44
|
executables: []
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- LICENSE.txt
|
57
57
|
- README.md
|
58
58
|
- Rakefile
|
59
|
+
- TODO.md
|
59
60
|
- diacritics.gemspec
|
60
61
|
- lib/diacritics.rb
|
61
62
|
- lib/diacritics/alphabet.rb
|
@@ -66,7 +67,7 @@ files:
|
|
66
67
|
- spec/diacritics/cases_spec.rb
|
67
68
|
- spec/diacritics/string_spec.rb
|
68
69
|
- spec/spec_helper.rb
|
69
|
-
homepage:
|
70
|
+
homepage: https://github.com/fractalsoft/diacritics
|
70
71
|
licenses:
|
71
72
|
- MIT
|
72
73
|
metadata: {}
|