瀏覽代碼

注释掉误提交代码

wangyu 5 年之前
父節點
當前提交
d1b0c11cd4

+ 8 - 5
nlp-web/src/main/java/org/diagbot/nlp/controller/FeatureController.java

@@ -19,7 +19,6 @@ import org.diagbot.nlp.util.NlpCache;
 import org.diagbot.nlp.util.NlpUtil;
 import org.diagbot.pub.api.Response;
 import org.diagbot.pub.jdbc.MysqlJdbc;
-import org.diagbot.pub.utils.PropertiesUtil;
 import org.diagbot.pub.web.BaseController;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
@@ -29,7 +28,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @Controller
 @RequestMapping("/feature")
@@ -148,12 +151,12 @@ public class FeatureController extends BaseController<Feature, FeatureWrapper, L
             Map<String, String> propel = null;
             List<Map<String, Object>> data = new ArrayList<>();
 
-            PropertiesUtil propertiesUtil = new PropertiesUtil("nlp.properties");
-            featureNum = propertiesUtil.getProperty("push.feature.num");
+           /* PropertiesUtil propertiesUtil = new PropertiesUtil("nlp.properties");
+            featureNum = propertiesUtil.getProperty("push.feature.num");*/
             FeatureAnalyze sa = new FeatureAnalyze();
             for (String featureType : featureTypes.split(",")) {
                 for (String feature : featureNum.split(",")) {
-                    sa.setFeatureNum(feature);
+                    /*sa.setFeatureNum(feature);*/
                     for (Info info : docInfos) {
                         switch (FeatureType.parse(featureType)) {
                             case SYMPTOM:

+ 4 - 4
nlp/src/main/java/org/diagbot/nlp/feature/FeatureAnalyze.java

@@ -18,7 +18,7 @@ import java.util.Map;
 
 public class FeatureAnalyze {
     private LexemePath<Lexeme> lexemePath = null;
-    private String featureNum = "";//特征提取范围
+/*    private String featureNum = "";//特征提取范围*/
 
     Logger logger = LoggerFactory.getLogger(FeatureAnalyze.class);
 
@@ -62,7 +62,7 @@ public class FeatureAnalyze {
 //        }
 //        logger.info("分词文本结果:" + lexeme_text);
         lexemePath = replaceLexeme(lexemePath);
-        caseToken.getFeatureSize(featureNum);
+        /*caseToken.getFeatureSize(featureNum);*/
         return caseToken.analyze(lexemePath);
     }
 
@@ -101,8 +101,8 @@ public class FeatureAnalyze {
         return lexemePath;
     }
 
-    public String setFeatureNum(String featureNum){
+  /*  public String setFeatureNum(String featureNum){
         this.featureNum = featureNum;
         return featureNum;
-    }
+    }*/
 }

+ 13 - 6
nlp/src/main/java/org/diagbot/nlp/feature/extract/CaseToken.java

@@ -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;
-    }
+    }*/
 }
 

+ 1 - 1
nlp/src/main/resources/nlp.properties

@@ -3,4 +3,4 @@ cache.file.dir=/opt/diagbot-push/cache_file/
 #cache.file.dir=e:\\cache_file\\
 
 #特征提取范围(不限制范围时配置:all)
-push.feature.num=all
+#push.feature.num=all