spanglify 0.1.0 → 0.1.1
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/lib/spanglify.rb +20 -6
- data/lib/spanglify/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd52ce2dca88a392a0affa1fa8c1b9ddcbe3ac33da0aa81590ee1887181dc240
|
4
|
+
data.tar.gz: acd04793d40b16d4600dd7150f759fe404219054357c6ee176facd64268dd385
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52cc53ddb0004e1dc935c981491a8c954972af1e29f22659094a1d9bb0baf21c3a748e45193b0b4c69f52287be90d74c45a21b57264cac0ad8639737afb8d736
|
7
|
+
data.tar.gz: ed96869e54e2946832b6719c973ab0966c81175a4b0593f703527b7a579fc365605d4afa0ee0ca50119bb162c355764f40d50bd54e874d9f13c78926759a9da2
|
data/lib/spanglify.rb
CHANGED
@@ -2,18 +2,32 @@ require "spanglify/version"
|
|
2
2
|
|
3
3
|
module Spanglify
|
4
4
|
def self.process(str)
|
5
|
-
|
5
|
+
#commonly interchanged English to Spanish words and phrases
|
6
6
|
to_swap = {
|
7
7
|
"are you" => "estás",
|
8
8
|
"very" => "muy",
|
9
9
|
"but" => "pero",
|
10
|
-
"
|
10
|
+
"i like" => "me gusta",
|
11
11
|
"party" => "fiesta",
|
12
|
-
"with" => "con"
|
13
|
-
"to check" => "chequear"
|
12
|
+
"with" => "con"
|
14
13
|
}
|
15
14
|
|
16
|
-
|
17
|
-
|
15
|
+
to_swap.each do |key, value|
|
16
|
+
#create a capitalized versions of the key and values
|
17
|
+
capitalized_key = key.capitalize
|
18
|
+
capitalized_value = value.capitalize
|
19
|
+
|
20
|
+
upcase_key = key.upcase
|
21
|
+
upcase_value = value.upcase
|
22
|
+
|
23
|
+
if str.include? "#{key}" #if the string contains the lowercase version of the English word(s)
|
24
|
+
str.gsub!(key, value) #swap out for the lowercase Spanish version of the word(s)
|
25
|
+
elsif str.include? "#{upcase_key}" #if the string contains the capitalized version of the English word(s)
|
26
|
+
str.gsub!(upcase_key, upcase_value) #swap out for the capitalized version of the Spanish word(s)
|
27
|
+
elsif str.include? "#{capitalized_key}" #if the string contains the uppercase version of the English word(s)
|
28
|
+
str.gsub!(capitalized_key, capitalized_value) #swap out for the uppercase version of the Spanish word(s)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
str #return the spanglified version of the string
|
18
32
|
end
|
19
33
|
end
|
data/lib/spanglify/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spanglify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephanie Fischler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,5 +83,5 @@ requirements: []
|
|
83
83
|
rubygems_version: 3.0.4
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
|
-
summary:
|
86
|
+
summary: Converts English phrases into the Spanish-English hybrid languagh, Spanglish
|
87
87
|
test_files: []
|