braille_ueb 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'rubygems'
2
+ require 'bundler/gem_tasks'
@@ -1,68 +1,69 @@
1
+ #encoding: UTF-8
1
2
  module BrailleUEB
2
3
 
3
4
  ALPHA = {
4
- "a" => "\u2801",
5
- "b" => "\u2803",
6
- "c" => "\u2809",
7
- "d" => "\u2819",
8
- "e" => "\u2811",
9
- "f" => "\u280b",
10
- "g" => "\u281b",
11
- "h" => "\u2813",
12
- "i" => "\u280a",
13
- "j" => "\u281a",
14
- "k" => "\u2805",
15
- "l" => "\u2807",
16
- "m" => "\u280d",
17
- "n" => "\u281d",
18
- "o" => "\u2815",
19
- "p" => "\u280f",
20
- "q" => "\u281f",
21
- "r" => "\u2817",
22
- "s" => "\u280e",
23
- "t" => "\u281e",
24
- "u" => "\u2825",
25
- "v" => "\u2827",
26
- "w" => "\u283a",
27
- "x" => "\u282d",
28
- "y" => "\u283d",
29
- "z" => "\u2835",
5
+ 'a' => '⠁',
6
+ 'b' => '⠃',
7
+ 'c' => '⠉',
8
+ 'd' => '⠙',
9
+ 'e' => '⠑',
10
+ 'f' => '⠋',
11
+ 'g' => '⠛',
12
+ 'h' => '⠓',
13
+ 'i' => '⠊',
14
+ 'j' => '⠚',
15
+ 'k' => '⠅',
16
+ 'l' => '⠇',
17
+ 'm' => '⠍',
18
+ 'n' => '⠝',
19
+ 'o' => '⠕',
20
+ 'p' => '⠏',
21
+ 'q' => '⠟',
22
+ 'r' => '⠗',
23
+ 's' => '⠎',
24
+ 't' => '⠞',
25
+ 'u' => '⠥',
26
+ 'v' => '⠧',
27
+ 'w' => '⠺',
28
+ 'x' => '⠭',
29
+ 'y' => '⠽',
30
+ 'z' => '⠵'
30
31
  }
31
32
 
32
33
  NUMBER = {
33
- "1" => "\u2801",
34
- "2" => "\u2803",
35
- "3" => "\u2809",
36
- "4" => "\u2819",
37
- "5" => "\u2811",
38
- "6" => "\u280b",
39
- "7" => "\u281b",
40
- "8" => "\u2813",
41
- "9" => "\u280a",
42
- "0" => "\u281a",
34
+ '1' => '⠁',
35
+ '2' => '⠃',
36
+ '3' => '⠉',
37
+ '4' => '⠙',
38
+ '5' => '⠑',
39
+ '6' => '⠋',
40
+ '7' => '⠛',
41
+ '8' => '⠓',
42
+ '9' => '⠊',
43
+ '0' => '⠚'
43
44
  }
44
45
 
45
46
  SPECIAL = {
46
- :capital => "\u2820",
47
- :number => "\u283c",
47
+ :capital => '⠠',
48
+ :number => '⠼'
48
49
  }
49
50
 
50
51
  PUNCTUATION = {
51
- "." => "\u2832",
52
- "," => "\u2802"
52
+ '.' => '⠲',
53
+ ',' => '⠂'
53
54
  }
54
55
 
55
56
  CONTRACTIONS = {
56
- "like" => "\u2807",
57
- "but" => "\u2803",
58
- "you" => "\u283D",
59
- "will" => "\u283A",
60
- "just" => "\u281A",
61
- "do" => "\u2819",
62
- "that" => "\u281E",
63
- "so" => "\u280E",
64
- "can" => "\u2809",
65
- "go" => "\u281B",
57
+ 'like' => '⠇',
58
+ 'but' => '⠃',
59
+ 'you' => '⠽',
60
+ 'will' => '⠺',
61
+ 'just' => '⠚',
62
+ 'do' => '⠙',
63
+ 'that' => '⠞',
64
+ 'so' => '⠎',
65
+ 'can' => '⠉',
66
+ 'go' => '⠛'
66
67
  }
67
68
 
68
69
  end
@@ -0,0 +1,3 @@
1
+ module BrailleUEB
2
+ VERSION = '0.0.2'
3
+ end
@@ -1,45 +1,46 @@
1
+ #encoding: UTF-8
1
2
  require_relative '../lib/braille_ueb'
2
3
 
3
4
  describe BrailleUEB do
4
5
 
5
- it "should convert the alphabet" do
6
- verify "a", "\u2801"
7
- verify "b", "\u2803"
8
- verify "c", "\u2809"
6
+ it 'should convert the alphabet' do
7
+ verify 'a', '⠁'
8
+ verify 'b', '⠃'
9
+ verify 'c', '⠉'
9
10
  end
10
11
 
11
- it "should convert capital letters" do
12
- verify "Z", "\u2820\u2835"
12
+ it 'should convert capital letters' do
13
+ verify 'Z', '⠠⠵'
13
14
  end
14
15
 
15
- it "should convert single numbers" do
16
- verify "1", "\u283c\u2801"
17
- verify "2", "\u283c\u2803"
18
- verify "3", "\u283c\u2809"
16
+ it 'should convert single numbers' do
17
+ verify '1', '⠼⠁'
18
+ verify '2', '⠼⠃'
19
+ verify '3', '⠼⠉'
19
20
  end
20
21
 
21
- it "should only put the number prefix for the the first number" do
22
- verify "12", "\u283c\u2801\u2803"
22
+ it 'should only put the number prefix for the the first number' do
23
+ verify '12', '⠼⠁⠃'
23
24
  end
24
25
 
25
- it "should convert a period to a full stop" do
26
- verify "Z.", "\u2820\u2835\u2832"
26
+ it 'should convert a period to a full stop' do
27
+ verify 'Z.', '⠠⠵⠲'
27
28
  end
28
29
 
29
- it "should convert a comma" do
30
- verify ",", "\u2802"
30
+ it 'should convert a comma' do
31
+ verify ',', '⠂'
31
32
  end
32
33
 
33
- it "should perform contractions" do
34
- verify "like", "\u2807"
34
+ it 'should perform contractions' do
35
+ verify 'like', '⠇'
35
36
  end
36
37
 
37
- it "should perform contractions that end with punctuation" do
38
- verify "like.", "\u2807\u2832"
38
+ it 'should perform contractions that end with punctuation' do
39
+ verify 'like.', '⠇⠲'
39
40
  end
40
41
 
41
- it "should captialize contractions" do
42
- verify "Like", "\u2820\u2807"
42
+ it 'should captialize contractions' do
43
+ verify 'Like', '⠠⠇'
43
44
  end
44
45
 
45
46
  def verify(english, braille)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braille_ueb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-15 00:00:00.000000000 Z
12
+ date: 2012-11-04 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A translator for Unified English Braille (UEB)
15
15
  email: chris@geihsler.net
@@ -17,8 +17,10 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
+ - Rakefile
20
21
  - lib/braille_ueb/char.rb
21
22
  - lib/braille_ueb/constants.rb
23
+ - lib/braille_ueb/version.rb
22
24
  - lib/braille_ueb/word.rb
23
25
  - lib/braille_ueb.rb
24
26
  - spec/braille_ueb_spec.rb