|
@@ -1,6 +1,5 @@
|
|
|
package org.diagbot.nlp.feature.extract;
|
|
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.diagbot.nlp.participle.word.Lexeme;
|
|
|
import org.diagbot.nlp.participle.word.LexemePath;
|
|
|
import org.diagbot.nlp.util.Constants;
|
|
@@ -23,7 +22,7 @@ public abstract class CaseToken {
|
|
|
protected Lexeme leftFeatureLexeme = null;
|
|
|
protected Lexeme rightFeatureLexeme = null;
|
|
|
protected int sn = 0;
|
|
|
- protected String featureSize = "";
|
|
|
+/* protected String featureSize = "";*/
|
|
|
|
|
|
static {
|
|
|
Arrays.sort(ignore_symbol);
|
|
@@ -104,7 +103,7 @@ public abstract class CaseToken {
|
|
|
}
|
|
|
}
|
|
|
if (!hasFeature) {
|
|
|
- if (StringUtils.isNotEmpty(featureSize)) {
|
|
|
+ /* if (StringUtils.isNotEmpty(featureSize)) {
|
|
|
if(featureSize.equals("all")){//featureSize为all时提取所有特征
|
|
|
Map<String, Object> fMap = new HashMap<>(10);
|
|
|
fMap.put("feature_name", lexeme.getText());
|
|
@@ -126,11 +125,19 @@ public abstract class CaseToken {
|
|
|
featuresList.add(fMap);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
+ Map<String, Object> fMap = new HashMap<>(10);
|
|
|
+ fMap.put("feature_name", lexeme.getText());
|
|
|
+ fMap.put("feature_type", featureType);
|
|
|
+ fMap.put("negative", key);
|
|
|
+ fMap.put("sn", String.valueOf(sn++));
|
|
|
+ fMap.put("property", lexeme.getProperty());
|
|
|
+ fMap.put("concept", lexeme.getConcept());
|
|
|
+ featuresList.add(fMap);
|
|
|
}
|
|
|
}
|
|
|
- public void getFeatureSize(String fetureSize){
|
|
|
+ /* public void getFeatureSize(String fetureSize){
|
|
|
this.featureSize = fetureSize;
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
|