Skip to content

Commit 4516b63

Browse files
committed
改名summary_map为summary_data.map2
1 parent 96b08ec commit 4516b63

File tree

5 files changed

+41
-36
lines changed

5 files changed

+41
-36
lines changed

checkessay.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ function show_check_results(only_unusual = false)
116116

117117
div_origChar.className += genClassNamesAccordingCInfo(essayChar);
118118

119-
if (summary_map[essayChar] && summary_map[essayChar]['rel'].length > 0) //有关联字
119+
if (summary_data.map2[essayChar] && summary_data.map2[essayChar]['rel'].length > 0) //有关联字
120120
{
121121
tips += "关联字:\n";
122122

123123
div_essayChar.className += " div_essay_char_haverel";
124124

125-
summary_map[essayChar]['rel'].forEach( function(relChar) {
125+
summary_data.map2[essayChar]['rel'].forEach( function(relChar) {
126126

127127
tips += genCharTipLine(relChar);
128128

@@ -150,7 +150,7 @@ function show_check_results(only_unusual = false)
150150
function genClassNamesAccordingCInfo(c)
151151
{
152152
var classNames = " ";
153-
// const mapObj = summary_map [c];
153+
// const mapObj = summary_data.map2 [c];
154154
const cInfo = getCInfo(c);
155155

156156
for (name of Object.keys(cInfo.unusuals) )
@@ -169,7 +169,7 @@ function genCharTipLine(c, charObj)
169169
var blk = charObj ? charObj.cInfo.blk : getCpBlock(hex);
170170

171171
var cProp = "";
172-
const mapObj = summary_map[c];
172+
const mapObj = summary_data.map2[c];
173173

174174
if (mapObj)
175175
{

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
<script type="text/javascript">
99
var opencc = {};
1010
var unicode_data = {};
11+
var summary_data = {};
1112
</script>
1213
<script type="text/javascript" src="unicode-data/unicode-data-blocks.js"></script>
1314
<script type="text/javascript" src="ucd.js"></script>
1415

15-
<script type="text/javascript" src="summary-data/summary-data-map.js"></script>
16+
<script type="text/javascript" src="summary-data/summary-data-map2.js"></script>
1617

1718
<script type="text/javascript" src="unusual_conditions.js"></script>
1819
<script type="text/javascript" src="checkessay.js"></script>

summary-data/pre.js

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
var opencc = {};
22
var unicode_data = {};
3-
var summary_map = {};
3+
var summary_data = {
4+
map: {}, // 仅繁简
5+
map2: {}, //繁简+兼 划 日 等
6+
map3: {}, //把对map2来说不必要的关联也加进来
7+
};
48
const chi_chars = ['醋', '予', '疏', '欠', '弁']; // 一些可能会被误判成日本简化字的中文字
59

610
var fs = require('fs');
@@ -13,23 +17,23 @@ async function start()
1317
{
1418
for (c in unicode_data.map2 )
1519
{
16-
summary_map [c] = combineCharObj(c, unicode_data.map2, opencc.map2);
20+
summary_data.map2 [c] = combineCharObj(c, unicode_data.map2, opencc.map2);
1721
}
1822

1923
for (c in opencc.map2 )
2024
{
21-
summary_map [c] = combineCharObj(c, unicode_data.map2, opencc.map2);
25+
summary_data.map2 [c] = combineCharObj(c, unicode_data.map2, opencc.map2);
2226
}
2327

2428
for (c of chi_chars)
2529
{
26-
createKey(c, summary_map);
27-
summary_map[c] ['isChi'] = true;
30+
createKey(c, summary_data.map2);
31+
summary_data.map2[c] ['isChi'] = true;
2832
}
2933

30-
for (c in summary_map)
34+
for (c in summary_data.map2)
3135
{
32-
const cObj = summary_map[c];
36+
const cObj = summary_data.map2[c];
3337

3438
if ( cObj['isChi'] && ! cObj['isTrad'] && cObj['isSimp'] )
3539
cObj['isTrad'] = true;
@@ -40,63 +44,63 @@ async function start()
4044

4145
// cat summary-data-map.js |grep -o 'is.*'|uniq|sort|uniq
4246

43-
for (c in summary_map)
47+
for (c in summary_data.map2)
4448
{
45-
const cObj = summary_map[c];
49+
const cObj = summary_data.map2[c];
4650

4751
if (cObj['isComp'])
4852
{
49-
var rels = getAllRel( summary_map, cObj['rel'] );
50-
updateCharRel(summary_map , c , rels);
53+
var rels = getAllRel( summary_data.map2, cObj['rel'] );
54+
updateCharRel(summary_data.map2 , c , rels);
5155
}
5256
}
5357

54-
for (c in summary_map)
58+
for (c in summary_data.map2)
5559
{
56-
const cObj = summary_map[c];
60+
const cObj = summary_data.map2[c];
5761

5862
if (cObj['isRad'])
5963
{
60-
var rels = getAllRel( summary_map, cObj['rel'] );
61-
updateCharRel(summary_map , c , rels);
64+
var rels = getAllRel( summary_data.map2, cObj['rel'] );
65+
updateCharRel(summary_data.map2 , c , rels);
6266
}
6367
}
6468

65-
for (c in summary_map)
69+
for (c in summary_data.map2)
6670
{
67-
const cObj = summary_map[c];
71+
const cObj = summary_data.map2[c];
6872

6973
if (cObj['isVari_TW'] && ( !cObj['isSimp'] && !cObj['isTrad'] ) )
7074
{
71-
var rels = getAllRel( summary_map, cObj['rel'] );
72-
updateCharRel(summary_map , c , rels);
75+
var rels = getAllRel( summary_data.map2, cObj['rel'] );
76+
updateCharRel(summary_data.map2 , c , rels);
7377
}
7478
}
7579

76-
for (c in summary_map)
80+
for (c in summary_data.map2)
7781
{
78-
const cObj = summary_map[c];
82+
const cObj = summary_data.map2[c];
7983

8084
if (cObj['isVari_HK'] && ( !cObj['isSimp'] && !cObj['isTrad'] ) )
8185
{
82-
var rels = getAllRel( summary_map, cObj['rel'] );
83-
updateCharRel(summary_map , c , rels);
86+
var rels = getAllRel( summary_data.map2, cObj['rel'] );
87+
updateCharRel(summary_data.map2 , c , rels);
8488
}
8589
}
8690

87-
for (c in summary_map)
91+
for (c in summary_data.map2)
8892
{
89-
const cObj = summary_map[c];
93+
const cObj = summary_data.map2[c];
9094

9195
if (cObj['isVari_JP'] && ( !cObj['isSimp'] && !cObj['isTrad'] ) )
9296
{
93-
var rels = getAllRel( summary_map, cObj['rel'] );
94-
updateCharRel(summary_map , c , rels);
97+
var rels = getAllRel( summary_data.map2, cObj['rel'] );
98+
updateCharRel(summary_data.map2 , c , rels);
9599
}
96100
}
97101

98-
summary_map = sortMapObj(summary_map);
99-
fs.writeFileSync("summary-data-map.js" , ( "summary_map = \n" + JSON.stringify(summary_map) + "\n;" )
102+
summary_data.map2 = sortMapObj(summary_data.map2);
103+
fs.writeFileSync("summary-data-map2.js" , ( "summary_data.map2 = \n" + JSON.stringify(summary_data.map2) + "\n;" )
100104
.replaceAll("},", "},\n")
101105
);
102106
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
summary_map =
1+
summary_data.map2 =
22
{"⺁":{"rel":["厂","廠"],"isRad":true},
33
"⺂":{"rel":["乛"],"isRad":true},
44
"⺃":{"rel":["乚"],"isRad":true},

unusual_conditions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function getCharUnusuals(c, cInfo)
131131

132132
if ( condObj['func'] )
133133
{
134-
var oneResult = condObj.func(c, summary_map[c], cInfo) ;
134+
var oneResult = condObj.func(c, summary_data.map2[c], cInfo) ;
135135
if (oneResult)
136136
{
137137
result[ name ] = oneResult;

0 commit comments

Comments
 (0)