Skip to content

Commit 183767e

Browse files
authored
Merge pull request #85 from n9tank/main
ling某叫我更新ndt数据集,我瞎弄给糊弄你们
2 parents 8d99b95 + 5944d34 commit 183767e

File tree

23 files changed

+1987
-743
lines changed

23 files changed

+1987
-743
lines changed

CODE_NDT/test.java

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,18 @@ public static void main(String[] args) throws Exception {
1616
/*
1717
https://products.aspose.app/cells/zh/conversion/xlsx-to-json
1818
NDT-1.15.json xlxs2json
19+
{
20+
"Column2": "代码",
21+
"Column3": "代码翻译",
22+
"Column4": "描述",
23+
"Column5": "例子",
24+
"Column6": "值类型",
25+
"键注意事项": "注意事项"
26+
},
1927
*/
2028
public static void outfromdata() throws Exception {
2129
JSONObject js=pare(new File("sdcard/a"));
30+
//git文件没更新数据集,自己换个
2231
BufferedWriter index=new BufferedWriter(new FileWriter(new File(outPath, "index.md")));
2332
index.write("# index");
2433
JSONArray list= js.getJSONArray("单位代码");
@@ -32,9 +41,9 @@ public static void outfromdata() throws Exception {
3241
}
3342
continue;
3443
}
35-
String str=obj.optString("key翻译");
44+
String str=obj.optString("Column3");
3645
if (str == null)continue;
37-
String key=obj.optString("key描述解释");
46+
String key=obj.optString("Column4");
3847
boolean isSection=key == null ?false: key.startsWith("[") && key.endsWith("]");
3948
if (isSection || str.matches("[a-zA-Z]{2,}")) {
4049
if (buff != null)buff.close();
@@ -59,13 +68,13 @@ public static void outfromdata() throws Exception {
5968
index.write(str);
6069
index.write(".md");
6170
index.write(")\n");
62-
index.write(obj.optString("key代码"));
71+
index.write(obj.optString("Column2"));
6372
buff = new BufferedWriter(new FileWriter(new File(outPath, str + ".md")));
6473
buff.write("# ");
6574
buff.write(rstr);
6675
buff.write("\n");
6776
} else if (buff != null) {
68-
key = obj.optString("key代码");
77+
key = obj.optString("Column2");
6978
if (key == null || key.length() == 0)continue;
7079
char c=key.charAt(0);
7180
if (Character.isLowerCase(c) || Character.isUpperCase(c) || c == '@') {
@@ -74,16 +83,14 @@ public static void outfromdata() throws Exception {
7483
buff.write("\ntranslation:");
7584
buff.write(str.replaceFirst(":$", ""));
7685
buff.write("\n<br>type:");
77-
String type=obj.optString("key值类型", "string");
86+
String type=obj.optString("Column6", "string");
7887
buff.write(type);
79-
String type2=obj.optString("Column8");
80-
if (type2 != null && type2.length() > 0) {
81-
if (!type.equals(type2)) {
82-
buff.write('/');
83-
buff.write(type2);
84-
}
88+
String type2 = obj.optString("Column5");
89+
if (type2 != null ){
90+
buff.write("\n<br>example:");
91+
buff.write(type2);
8592
}
86-
str = obj.optString("key描述解释");
93+
str = obj.optString("Column4");
8794
if (str != null) {
8895
buff.write("\n<br>");
8996
buff.write(str);
@@ -103,4 +110,3 @@ public static JSONObject pare(File f) throws Exception {
103110
return new JSONObject(new String(by));
104111
}
105112
}
106-

0 commit comments

Comments
 (0)