Changeset 726
 Timestamp:
 10/26/07 04:25:44 (9 years ago)
 Files:

 1 modified
Legend:
 Unmodified
 Added
 Removed

lang/javascript/romkanmini/romkanmini.js
r724 r726 2 2 vowels: "aiueo", 3 3 cons1: "kgsztdnhbpmyrwfjlx", 4 cons2: "qy\u0000ky\u0000sh\u0000sy\u0000ch\u0000ty\u0000cy\u0000 gy\u0000jy\u0000zy\u0000ts",4 cons2: "qy\u0000ky\u0000sh\u0000sy\u0000ch\u0000ty\u0000cy\u0000ny\u0000hy\u0000gy\u0000jy\u0000zy\u0000dy\u0000dh\u0000ts", 5 5 con_kanas: [0x304b, 0x304c, 0x3055, 0x3056, 0x305f, 6 6 0x3060, 0x306a, 0x306f, 0x3070, 0x3071, … … 9 9 21: 2, // shi > si 10 10 41: 4, // chi > ti 11 1 02: 4 // tsu > tu11 142: 4 // tsu > tu 12 12 }, 13 13 … … 25 25 }, 26 26 27 con2_map_y: { 28 0: 'く', 29 1: 'き', 30 2: 'し', 31 3: 'し', 32 4: 'ち', 33 5: 'ち', 34 6: 'ち', 35 7: 'ぎ', 36 8: 'じ', 37 9: 'じ', 38 }, 27 con2_map_y: 'くきししちちちにひぎじじぢで', 39 28 40 29 to_kana: function(s) { … … 53 42 return 1; 54 43 55 if (s .charAt(start)== '')44 if (s[start] == '') 56 45 { 57 46 out.unshift('\u30fc'); … … 68 57 if (ci >= 0) 69 58 { 70 var ci_nrm = this.ntbl[ci*10+vi]; 71 if (ci_nrm != void(0)) 59 var key = ci*10+vi; 60 var ci_nrm; 61 if (ci_nrm = this.ntbl[key]) 72 62 { 73 63 c1_normalized = true; … … 77 67 else 78 68 { 79 var sp = this.con2_special_tbl[ ci*10+vi];69 var sp = this.con2_special_tbl[key]; 80 70 if (sp != void(0)) 81 71 out.unshift(sp); … … 86 76 } 87 77 88 if (start > 2 && s .charAt(start2) == s.charAt(start3))78 if (start > 2 && s[start2] == s[start3] && 'n' != s[start2]) 89 79 { 90 80 out.unshift('\u3063'); … … 105 95 if (ci == 6 && start > 1) 106 96 { 107 if (s .charAt(start  2)== 'n')108 { 109 if (start < 3  s .charAt(start  3)!= 'n')97 if (s[start  2] == 'n') 98 { 99 if (start < 3  s[start  3] != 'n') 110 100 { 111 101 out.unshift(this._get_c1v1(1, vi)); … … 116 106 } 117 107 118 if (start > 1 && "lx".indexOf(s .charAt(start2)) >= 0)108 if (start > 1 && "lx".indexOf(s[start2]) >= 0) 119 109 { 120 110 if (ci == 4 && vi == 2) … … 127 117 out.unshift(this._get_c1v1(ci, vi)); 128 118 129 if (start > 1 && s .charAt(start1) == s.charAt(start2) && 'n' != s.charAt(start2))119 if (start > 1 && s[start1] == s[start2] && 'n' != s[start2]) 130 120 { 131 121 out.unshift('\u3063'); … … 142 132 else 143 133 { 144 if (s .charAt(start)== 'n')134 if (s[start] == 'n') 145 135 { 146 136 out.unshift('\u3093'); 147 return start  ((s .charAt(start1)== 'n') ? 2 : 1);137 return start  ((s[start1] == 'n') ? 2 : 1); 148 138 } 149 139 } 150 140 151 out.unshift(s .charAt(start));141 out.unshift(s[start]); 152 142 153 143 return start1; … … 181 171 shift = 1; 182 172 183 if (ci == 6  ci == 10  ci == 11  ci == 12  ci == 13)173 if (ci == 6  (ci >= 10 && ci <= 13)) 184 174 fct = 1; 185 else if (ci == 7  ci == 8  ci == 9)175 else if (ci >= 7 && ci <= 9) 186 176 fct = 3; 187 177 … … 209 199 return 1; 210 200 211 var p = tbl.indexOf(s .charAt(start));201 var p = tbl.indexOf(s[start]); 212 202 if (p < 0) 213 203 return 1;