|
|
|
@ -105,7 +105,8 @@ public class A13 {
|
|
|
|
|
if (out && parent > 0) {
|
|
|
|
|
if (!content.startsWith("(")) continue;
|
|
|
|
|
if (parent == idx) {
|
|
|
|
|
list.add(content.split("。")[0]);
|
|
|
|
|
String c = killKuoHao(content.split("。")[0]);
|
|
|
|
|
list.add("• " + c);
|
|
|
|
|
}
|
|
|
|
|
out = false;
|
|
|
|
|
}
|
|
|
|
@ -163,6 +164,13 @@ public class A13 {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String killKuoHao(String originalString) {
|
|
|
|
|
// 正则表达式匹配中文括号、英文圆括号、方括号和花括号内的内容
|
|
|
|
|
String regex = "([^)]*)|\\([^\\)]*\\)|【[^】]*】|\\{[^}]*\\}";
|
|
|
|
|
// 替换掉匹配的内容
|
|
|
|
|
return originalString.replaceAll(regex, "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) throws IOException, DocumentException, NoApiKeyException, InputRequiredException {
|
|
|
|
|
//初始化数据库连接
|
|
|
|
|
LocalMysqlConnectUtil.Init();
|
|
|
|
@ -214,19 +222,37 @@ public class A13 {
|
|
|
|
|
DsKit.unCompress(file.getAbsolutePath());
|
|
|
|
|
|
|
|
|
|
List<String> list4 = get(4);
|
|
|
|
|
//如果list4的元素个数不足7个,需要补全到7个,空的用空字符串
|
|
|
|
|
if (list4.size() < 7) {
|
|
|
|
|
for (int i = list4.size(); i < 7; i++) {
|
|
|
|
|
list4.add("");
|
|
|
|
|
try {
|
|
|
|
|
//截取 小学 初中 高中 后面的文字,看看是不是一样的
|
|
|
|
|
String prefix = list4.get(1).split("小学")[0];
|
|
|
|
|
String xx = list4.get(1).split("小学")[1];
|
|
|
|
|
String cz = list4.get(2).split("初中")[1];
|
|
|
|
|
String gz = list4.get(3).split("高中")[1];
|
|
|
|
|
//三个全相同,需要三个合并
|
|
|
|
|
if (xx.equals(cz) && xx.equals(gz)) {
|
|
|
|
|
for (int i = 1; i <= 3; i++) list4.removeLast();
|
|
|
|
|
list4.add(prefix + "小学、初中、高中" + xx);
|
|
|
|
|
}
|
|
|
|
|
//如果小学和初中一样
|
|
|
|
|
else if (xx.equals(cz)) {
|
|
|
|
|
for (int i = 1; i <= 3; i++) list4.removeLast();
|
|
|
|
|
list4.add(prefix + "小学、初中" + xx);
|
|
|
|
|
list4.add(prefix + "高中" + gz);
|
|
|
|
|
} else if (cz.equals(gz)) {
|
|
|
|
|
for (int i = 1; i <= 3; i++) list4.removeLast();
|
|
|
|
|
list4.add(prefix + "小学" + xx);
|
|
|
|
|
list4.add(prefix + "初中、高中" + gz);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception err) {
|
|
|
|
|
}
|
|
|
|
|
//如果list4的元素个数不足8个,需要补全到8个,空的用空字符串
|
|
|
|
|
for (int i = list4.size(); i < 8; i++) {
|
|
|
|
|
list4.add("");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
//String content = get2012Summary(file.getAbsolutePath());
|
|
|
|
|
//String question = "帮我对下面内容进行归纳总结润色,不超过30字:";
|
|
|
|
|
//question += content;
|
|
|
|
|
// String tz = callTongYiQianWen(question);
|
|
|
|
|
String tz = "";
|
|
|
|
|
DsKit.putData(outRow, Arrays.asList(areaName, "教育特征", tz,
|
|
|
|
|
DsKit.putData(outRow, Arrays.asList(areaName, "教育特征",
|
|
|
|
|
rs(list4.getFirst()),
|
|
|
|
|
rs(list4.get(1)),
|
|
|
|
|
rs(list4.get(2)),
|
|
|
|
@ -234,10 +260,10 @@ public class A13 {
|
|
|
|
|
rs(list4.get(4)),
|
|
|
|
|
rs(list4.get(5)),
|
|
|
|
|
rs(list4.get(6)),
|
|
|
|
|
rs(list4.get(7)),
|
|
|
|
|
cityName), dataStyle);
|
|
|
|
|
|
|
|
|
|
List<String> list5 = get(5);
|
|
|
|
|
System.out.println(list5);
|
|
|
|
|
//如果list5的元素个数不足8个,需要补全到8个,空的用空字符串
|
|
|
|
|
if (list5.size() < 8) {
|
|
|
|
|
for (int i = list5.size(); i < 8; i++) {
|
|
|
|
@ -255,7 +281,6 @@ public class A13 {
|
|
|
|
|
rs(list5.get(6)),
|
|
|
|
|
rs(list5.get(7)),
|
|
|
|
|
cityName), dataStyle);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|