make[1]: Entering directory `/home/bill/dev/pseudoloc' Coverage

Coverage

100%
26
26
0

core/option.js

100%
4
4
0
LineHitsSource
1/**
2* Option.js
3*
4* Pseudolocalization options.
5*
6* (c) 2013 Bill, BunKat LLC.
7* Pseudoloc is freely distributable under the MIT license.
8* For all details and documentation:
9* http://bunkat.github.com/pseudoloc
10*/
111pseudoloc.option = {};
12
131pseudoloc.reset = function() {
1413 pseudoloc.option = {
15 prepend: '[##',
16 append: '@@]',
17 delimiter: '%',
18 extend: 0,
19 override: undefined
20 };
21};
22
231pseudoloc.reset();

core/pad.js

100%
5
5
0
LineHitsSource
1/**
2* Pad.js
3*
4* Pads a string with additional characters.
5*
6* (c) 2013 Bill, BunKat LLC.
7* Pseudoloc is freely distributable under the MIT license.
8* For all details and documentation:
9* http://bunkat.github.com/pseudoloc
10*/
111pseudoloc.pad = function(str, percent) {
12
1312 var len = Math.floor(str.length * percent),
14 pStr = str;
15
1612 while(len--) {
174 pStr += ' ';
18 }
19
2012 return pStr;
21};

core/str.js

100%
16
16
0
LineHitsSource
1/**
2* Str.js
3*
4* Replaces all characters in str with pseudolocalized version according to
5* pseudoloc.options.
6*
7* (c) 2013 Bill, BunKat LLC.
8* Pseudoloc is freely distributable under the MIT license.
9* For all details and documentation:
10* http://bunkat.github.com/pseudoloc
11*/
121pseudoloc.str = function(str) {
1312 var opts = pseudoloc.option,
14 delim = opts.delimiter,
15 re = new RegExp(delim + '([^' + delim + ']*)' + delim, 'g'),
16 m, tokens = [], i = 0, tokenIdx = 0, result = '', c, pc;
17
1812 while((m = re.exec(str))) {
195 tokens.push(m);
20 }
21
2212 var token = tokens[tokenIdx++] || {index: -1};
2312 while(i < str.length) {
24
25191 if(token.index === i) {
265 result += token[0];
275 i += token[0].length;
285 token = tokens[tokenIdx++] || {index: -1};
295 continue;
30 }
31
32186 c = opts.override !== undefined ? opts.override : str[i];
33186 pc = pseudoloc.table[c];
34186 result += pc ? pc[(Math.random() * pc.length) | 0] : c;
35186 i++;
36 }
37
3812 return opts.prepend + pseudoloc.pad(result, opts.extend) + opts.append;
39};

core/table.js

100%
1
1
0
LineHitsSource
1/**
2* Table.js
3*
4* Character replacement table.
5*
6* (c) 2013 Bill, BunKat LLC.
7* Pseudoloc is freely distributable under the MIT license.
8* For all details and documentation:
9* http://bunkat.github.com/pseudoloc
10*/
111pseudoloc.table = {
12 A: String.fromCharCode(192,193,194,195,196,197,256,258,260,506,512,514),
13 a: String.fromCharCode(224,225,226,227,228,229,257,259,261,507,513,515),
14 B: String.fromCharCode(223,385,579,665),
15 b: String.fromCharCode(384,386,387,388,389,595),
16 C: String.fromCharCode(262,264,266,268),
17 c: String.fromCharCode(263,265,267,269),
18 D: String.fromCharCode(270,272,393,394),
19 d: String.fromCharCode(271,273),
20 E: String.fromCharCode(274,276,278,280,282,516,518),
21 e: String.fromCharCode(275,277,279,281,283,517,519),
22 F: String.fromCharCode(401),
23 f: String.fromCharCode(402),
24 G: String.fromCharCode(284,286,288,290),
25 g: String.fromCharCode(285,287,289,291),
26 H: String.fromCharCode(292,294),
27 h: String.fromCharCode(293,295),
28 I: String.fromCharCode(296,298,300,302,304),
29 i: String.fromCharCode(297,299,301,303,305),
30 J: String.fromCharCode(309),
31 j: String.fromCharCode(308),
32 K: String.fromCharCode(310,408),
33 k: String.fromCharCode(311,312,409),
34 L: String.fromCharCode(313,315,317,319,321),
35 l: String.fromCharCode(314,316,318,320,322),
36 N: String.fromCharCode(323,325,327,330,413),
37 n: String.fromCharCode(324,326,328,329,331,414),
38 O: String.fromCharCode(332,334,336,416),
39 o: String.fromCharCode(333,335,337,417),
40 P: String.fromCharCode(420),
41 p: String.fromCharCode(421,447),
42 Q: String.fromCharCode(490,492),
43 q: String.fromCharCode(491,493,587),
44 R: String.fromCharCode(340,342,344,422),
45 r: String.fromCharCode(341,343,345),
46 S: String.fromCharCode(346,348,350,352),
47 s: String.fromCharCode(347,349,351,353),
48 T: String.fromCharCode(354,356,358),
49 t: String.fromCharCode(355,357,359),
50 U: String.fromCharCode(360,362,364,366,368,370),
51 u: String.fromCharCode(361,363,365,367,369,371),
52 W: String.fromCharCode(372),
53 w: String.fromCharCode(373),
54 Y: String.fromCharCode(374,376,435,562,590),
55 y: String.fromCharCode(375,436,563,591),
56 Z: String.fromCharCode(377,379,381,437),
57 z: String.fromCharCode(378,380,382,438)
58};
make[1]: Leaving directory `/home/bill/dev/pseudoloc'