|
@@ -1,11 +1,6 @@
|
|
package com.lantone.qc.trans.comsis;
|
|
package com.lantone.qc.trans.comsis;
|
|
|
|
|
|
-import com.google.common.collect.Lists;
|
|
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
-import com.lantone.qc.pub.model.keys.ModelStandardKeys;
|
|
|
|
-import com.lantone.qc.pub.util.FileUtil;
|
|
|
|
-import com.lantone.qc.pub.util.ListUtil;
|
|
|
|
-import com.lantone.qc.pub.util.StringUtil;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.LinkedHashMap;
|
|
@@ -35,7 +30,7 @@ public class Preproc {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public static Map<String, String> extract_doc_pub(boolean isProgress, List<String> title, String line) {
|
|
public static Map<String, String> extract_doc_pub(boolean isProgress, List<String> title, String line) {
|
|
-// line = line.replaceAll("[ *| *| *]*", "");
|
|
|
|
|
|
+ // line = line.replaceAll("[ *| *| *]*", "");
|
|
int pos = 0;
|
|
int pos = 0;
|
|
int ln_pos = 0;
|
|
int ln_pos = 0;
|
|
String item = "";
|
|
String item = "";
|
|
@@ -47,8 +42,8 @@ public class Preproc {
|
|
|
|
|
|
for (String key : title) {
|
|
for (String key : title) {
|
|
Pattern pattern = Pattern.compile(key);
|
|
Pattern pattern = Pattern.compile(key);
|
|
- Matcher matcher=pattern.matcher(line);
|
|
|
|
- while(matcher.find()){
|
|
|
|
|
|
+ Matcher matcher = pattern.matcher(line);
|
|
|
|
+ while (matcher.find()) {
|
|
key = matcher.group(0);
|
|
key = matcher.group(0);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -104,9 +99,9 @@ public class Preproc {
|
|
}
|
|
}
|
|
sections.put(lbl, item);
|
|
sections.put(lbl, item);
|
|
|
|
|
|
- Map<String,String> sectionsNew = Maps.newHashMap();
|
|
|
|
- sections.keySet().forEach(key->{
|
|
|
|
- sectionsNew.put(key.replaceAll("[\\s\\p{Zs}]",""),sections.get(key));
|
|
|
|
|
|
+ Map<String, String> sectionsNew = Maps.newHashMap();
|
|
|
|
+ sections.keySet().forEach(key -> {
|
|
|
|
+ sectionsNew.put(key.replaceAll("[\\s\\p{Zs}]", ""), sections.get(key));
|
|
});
|
|
});
|
|
|
|
|
|
return sectionsNew;
|
|
return sectionsNew;
|