File tree Expand file tree Collapse file tree 2 files changed +33
-19
lines changed Expand file tree Collapse file tree 2 files changed +33
-19
lines changed Original file line number Diff line number Diff line change 1
- Beta Code JS
2
- ===================
1
+ # Beta Code JS
3
2
4
- Overview
5
- --------
3
+ ## Overview
6
4
7
5
Converts Greek beta code to Greek characters and vice versa.
8
6
9
- Try it Out
10
- ----------
7
+ ## Try it Out
11
8
12
- [ https://zfletch.github.io /beta-code-converter-js / ] ( https://zfletch.github.io /beta-code-converter-js / )
9
+ [ https://apps.perseids.org /beta-code/ ] ( https://apps.perseids.org /beta-code/ )
13
10
14
- Installation
15
- ------------
11
+ ## Installation
16
12
17
13
` npm install beta-code-js `
18
14
19
- Usage
20
- -----
15
+ ## Usage
21
16
22
17
``` javascript
23
18
import { greekToBetaCode , betaCodeToGreek } from ' beta-code-js' ;
@@ -42,8 +37,7 @@ bc.betaCodeToGreek('mh=nin a)/eide qea\\ *phlhi+a/dew *)axilh=os');
42
37
43
38
```
44
39
45
- Usage in Browser
46
- ----------------
40
+ ## Usage in Browser
47
41
48
42
``` html
49
43
<html >
@@ -61,18 +55,29 @@ Usage in Browser
61
55
</html >
62
56
```
63
57
64
- Tests
65
- -----
58
+ ## Tests
66
59
67
60
` npm test `
68
61
69
- Building for Browser
70
- --------------------
62
+ ## Building for Browser
71
63
72
64
` npm run bundle `
73
65
74
- Notes
75
- -----
66
+ ## Updating JSON
67
+
68
+ ``` bash
69
+ git subtree pull --prefix vendor/beta-code-json/ https://github.com/zfletch/beta-code-json master --squash
70
+ ```
71
+
72
+ In the case of a merge conflict:
73
+
74
+ ``` bash
75
+ git checkout --theirs vendor/beta-code-json/ # if necessary
76
+ git add vendor/beta-code-json
77
+ git commit
78
+ ```
79
+
80
+ ## Notes
76
81
77
82
For the mappings between beta code and Unicode, see [ https://github.com/zfletch/beta-code-json ] ( https://github.com/zfletch/beta-code-json ) .
78
83
For an example of this package being used, see [ https://github.com/zfletch/beta-code-converter-js ] ( https://github.com/zfletch/beta-code-converter-js ) .
Original file line number Diff line number Diff line change @@ -71,5 +71,14 @@ describe('#betaCodeToGreek', function() {
71
71
expect ( bc . betaCodeToGreek ( beta_code1 ) ) . to . equal ( greek ) ;
72
72
expect ( bc . betaCodeToGreek ( beta_code2 ) ) . to . equal ( greek ) ;
73
73
} ) ;
74
+
75
+ it ( 'should convert characters with different capitalization orders' , function ( ) {
76
+ var beta_code1 = '*o(/rkos *a)/zwton *e(/llhnas *a)=pis' ;
77
+ var beta_code2 = '*(/orkos *)/azwton *(/ellhnas *)=apis' ;
78
+ var greek = 'Ὅρκος Ἄζωτον Ἕλληνας Ἆπις' ;
79
+
80
+ expect ( bc . betaCodeToGreek ( beta_code1 ) ) . to . equal ( greek ) ;
81
+ expect ( bc . betaCodeToGreek ( beta_code2 ) ) . to . equal ( greek ) ;
82
+ } ) ;
74
83
} ) ;
75
84
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments