|
@@ -1,6 +1,7 @@
|
|
package org.diagbot.common.push.filter.pretreat;
|
|
package org.diagbot.common.push.filter.pretreat;
|
|
|
|
|
|
import org.diagbot.common.push.bean.PreResult;
|
|
import org.diagbot.common.push.bean.PreResult;
|
|
|
|
+import org.diagbot.nlp.participle.ParticipleUtil;
|
|
import org.diagbot.nlp.participle.word.Lexeme;
|
|
import org.diagbot.nlp.participle.word.Lexeme;
|
|
import org.diagbot.nlp.participle.word.LexemePath;
|
|
import org.diagbot.nlp.participle.word.LexemePath;
|
|
import org.diagbot.nlp.util.NegativeEnum;
|
|
import org.diagbot.nlp.util.NegativeEnum;
|
|
@@ -9,8 +10,23 @@ import org.diagbot.nlp.util.NlpUtil;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
public class PretreatmentSymptom extends Pretreatment {
|
|
public class PretreatmentSymptom extends Pretreatment {
|
|
|
|
+ protected NegativeEnum[] nees_symptom = new NegativeEnum[]{NegativeEnum.SYMPTOM};
|
|
|
|
+
|
|
public List<PreResult> analyze(String content) throws java.io.IOException{
|
|
public List<PreResult> analyze(String content) throws java.io.IOException{
|
|
- return super.analyzeDefault(content);
|
|
|
|
|
|
+ List<PreResult> preResults = super.analyzeDefault(content);
|
|
|
|
+
|
|
|
|
+ LexemePath<Lexeme> lexemes = ParticipleUtil.participle(content);
|
|
|
|
+ for (int i = 0; i < lexemes.size(); i++) {
|
|
|
|
+ Lexeme l = lexemes.get(i);
|
|
|
|
+ PreResult result = new PreResult();
|
|
|
|
+ result.setUniqueName("症状--");
|
|
|
|
+ result.setDetailName("症状--");
|
|
|
|
+ if (NlpUtil.isFeature(l.getProperty(), nees_symptom)) {
|
|
|
|
+ result.setValue(NlpUtil.concept(l, NegativeEnum.SYMPTOM));
|
|
|
|
+ preResults.add(result);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return preResults;
|
|
}
|
|
}
|
|
|
|
|
|
public PreResult createPreResult(LexemePath<Lexeme> lexemes, Lexeme lexeme, int index) {
|
|
public PreResult createPreResult(LexemePath<Lexeme> lexemes, Lexeme lexeme, int index) {
|