|
@@ -121,10 +121,13 @@ public class NNDataSetImpl extends NNDataSet {
|
|
|
|
|
|
String featureName = "";
|
|
String featureName = "";
|
|
String[] splitWords = null;
|
|
String[] splitWords = null;
|
|
- Integer negative = 1;
|
|
|
|
Map<String, String> featureValues = null;
|
|
Map<String, String> featureValues = null;
|
|
|
|
+ Entry<String, Map<String, String>> entry;
|
|
|
|
+
|
|
|
|
+ Map<String, Map<String, String>> tempHashMap = new HashMap<>(); // 用于暂存key, value
|
|
|
|
+
|
|
while (entries.hasNext()) {
|
|
while (entries.hasNext()) {
|
|
- Entry<String, Map<String, String>> entry = entries.next();
|
|
|
|
|
|
+ entry = entries.next();
|
|
featureName = entry.getKey();
|
|
featureName = entry.getKey();
|
|
if (this.FEATURE_DICT.get(featureName) == null // 特征字典中没有然后再分词
|
|
if (this.FEATURE_DICT.get(featureName) == null // 特征字典中没有然后再分词
|
|
&& this.RE_SPLIT_WORD_DICT.get(featureName) != null) {
|
|
&& this.RE_SPLIT_WORD_DICT.get(featureName) != null) {
|
|
@@ -133,12 +136,13 @@ public class NNDataSetImpl extends NNDataSet {
|
|
for (String word : splitWords) { // 添加细分词项
|
|
for (String word : splitWords) { // 添加细分词项
|
|
featureValues = new HashMap<>();
|
|
featureValues = new HashMap<>();
|
|
featureValues.put("negative", "有"); // 设置为阳性词
|
|
featureValues.put("negative", "有"); // 设置为阳性词
|
|
- inputs.put(word, featureValues);
|
|
|
|
|
|
+ tempHashMap.put(word, featureValues);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ inputs.putAll(tempHashMap);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|