Skip to content

Commit f90c5be

Browse files
committed
增加作为备用的ndt数据集
1 parent 3239447 commit f90c5be

27 files changed

+24656
-1
lines changed

CODE_NDT/a

Lines changed: 19730 additions & 0 deletions
Large diffs are not rendered by default.

CODE_NDT/test.java

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
2+
import java.io.BufferedWriter;
3+
import java.io.File;
4+
import java.io.FileInputStream;
5+
import java.io.FileWriter;
6+
import org.json.JSONArray;
7+
import org.json.JSONObject;
8+
9+
public class test {
10+
static File outPath=new File("sdcard/out");
11+
public static void main(String[] args) throws Exception {
12+
outPath.mkdirs();
13+
outfromdata();
14+
System.out.println();
15+
}
16+
/*
17+
https://products.aspose.app/cells/zh/conversion/xlsx-to-json
18+
NDT-1.15.json xlxs2json
19+
*/
20+
public static void outfromdata() throws Exception {
21+
JSONObject js=pare(new File("sdcard/a"));
22+
BufferedWriter index=new BufferedWriter(new FileWriter(new File(outPath, "index.md")));
23+
index.write("# index");
24+
JSONArray list= js.getJSONArray("单位代码");
25+
BufferedWriter buff=null;
26+
for (int i=0;i < list.length();++i) {
27+
JSONObject obj=list.optJSONObject(i);
28+
if (obj == null) {
29+
if (buff != null) {
30+
buff.close();
31+
buff = null;
32+
}
33+
continue;
34+
}
35+
String str=obj.optString("key翻译");
36+
if (str == null)continue;
37+
String key=obj.optString("key描述解释");
38+
boolean isSection=key == null ?false: key.startsWith("[") && key.endsWith("]");
39+
if (isSection || str.matches("[a-zA-Z]{2,}")) {
40+
if (buff != null)buff.close();
41+
if (isSection) {
42+
int j=key.indexOf('_');
43+
if (j < 0)j = key.length() - 1;
44+
str = key.substring(1, j);
45+
}
46+
if ("comment".equals(str)) {
47+
continue;
48+
}
49+
index.write("\n## [");
50+
char c=str.charAt(0);
51+
if (c >= 'A' && c <= 'Z') {
52+
char[] crr=str.toCharArray();
53+
crr[0]=Character.toLowerCase(c);
54+
str = new String(crr);
55+
}
56+
index.write(str.equals("leg") ?"leg/arm": str.equals("global") ?"global_resource": str);
57+
index.write("](");
58+
index.write(str);
59+
index.write(".md");
60+
index.write(")\n");
61+
index.write(obj.optString("key代码"));
62+
buff = new BufferedWriter(new FileWriter(new File(outPath, str + ".md")));
63+
buff.write("# ");
64+
buff.write(str);
65+
buff.write("\n");
66+
} else if (buff != null) {
67+
key = obj.optString("key代码");
68+
if (key == null || key.length() == 0)continue;
69+
char c=key.charAt(0);
70+
if (Character.isLowerCase(c) || Character.isUpperCase(c) || c == '@') {
71+
buff.write("## ");
72+
buff.write(key);
73+
buff.write("\ntranslation:");
74+
buff.write(str.replaceFirst(":$", ""));
75+
buff.write("\n<br>type:");
76+
String type=obj.optString("key值类型", "string");
77+
buff.write(type);
78+
String type2=obj.optString("Column8");
79+
if (type2 != null && type2.length() > 0) {
80+
if (!type.equals(type2)) {
81+
buff.write('/');
82+
buff.write(type2);
83+
}
84+
}
85+
str = obj.optString("key描述解释");
86+
if (str != null) {
87+
buff.write("\n<br>");
88+
buff.write(str);
89+
}
90+
buff.write('\n');
91+
}
92+
}
93+
}
94+
if (buff != null)
95+
buff.close();
96+
index.close();
97+
}
98+
public static JSONObject pare(File f) throws Exception {
99+
FileInputStream fi=new FileInputStream(f);
100+
byte[] by=new byte[fi.available()];
101+
fi.read(by);
102+
return new JSONObject(new String(by));
103+
}
104+
}
105+

rustedwarfareapicode/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ features:
2828
details: 学习最基础的铁锈单位API-Code
2929
link: /src/Unit/core
3030
linkText: 让我们立刻开始吧!
31+
- title: 单位代码表(NDT)
32+
details: NDT数据集
33+
link: /src/UnitNDT/index
34+
linkText: 查阅
3135
- title: 地图代码表
3236
details: 学习铁锈的地图TMX代码表
3337
link: /src/Map/all

rustedwarfareapicode/src/Map/trigger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ outline: deep
371371
```
372372
373373
- **repeatDelay**
374-
- 重复延迟。宾语被触发后,再次执行效果的时间(会被 `deactivatedBy` 终止)。
374+
- 重复延迟。宾语被触发后,再次执行效果的时间(不会检查`activatedBy`,会被 `deactivatedBy` 终止)。
375375
- `time`
376376
377377
- **deactivatedBy**

0 commit comments

Comments
 (0)