Kaynağa Gözat

push python,nodejs等一系列脚本

XuShengTao 6 yıl önce
ebeveyn
işleme
9ef2f3a73d
53 değiştirilmiş dosya ile 6173 ekleme ve 35 silme
  1. 6 0
      .gitignore
  2. BIN
      nodejs/image3.png
  3. 191 0
      nodejs/learncoder.js
  4. 0 0
      nodejs/output.json
  5. 337 0
      nodejs/package-lock.json
  6. 82 0
      nodejs/pic.js
  7. 16 0
      pom.xml
  8. BIN
      python/SvmClassifier.model
  9. BIN
      python/__pycache__/const.cpython-38.pyc
  10. BIN
      python/__pycache__/load_data.cpython-38.pyc
  11. 394 0
      python/const.py
  12. 4106 0
      python/dict/stop_words.txt
  13. 94 0
      python/load_data.py
  14. BIN
      python/naiveBayesrClassifier.model
  15. 74 0
      python/web.py
  16. 0 0
      python/x_tr_list.json
  17. 0 0
      python/y_tr_list.json
  18. 1 1
      src/main/java/com/seec/bok/back/controller/QuestionController.java
  19. 71 1
      src/main/java/com/seec/bok/back/controller/WebRestfulController.java
  20. 55 0
      src/main/java/com/seec/bok/back/domainobject/Pdf.java
  21. 28 10
      src/main/java/com/seec/bok/back/domainobject/QuestionDO.java
  22. 24 0
      src/main/java/com/seec/bok/back/domainobject/QuestionType.java
  23. 1 1
      src/main/java/com/seec/bok/back/entity/ChoiceQuestion.java
  24. 35 4
      src/main/java/com/seec/bok/back/entity/Question.java
  25. 2 1
      src/main/java/com/seec/bok/back/repository/QuestionRepository.java
  26. 7 0
      src/main/java/com/seec/bok/back/repository/QuestionRepositoryImp.java
  27. 24 0
      src/main/java/com/seec/bok/back/utils/EachPagePDFTextStripper.java
  28. 17 0
      src/main/java/com/seec/bok/back/utils/FileUtil.java
  29. 27 0
      src/main/java/com/seec/bok/back/utils/Util.java
  30. 3 3
      src/main/java/com/seec/bok/graphql/resolver/PostQuery.java
  31. 25 5
      src/main/java/com/seec/bok/proxy/ProxyController.java
  32. 103 1
      src/main/java/com/seec/bok/recommend/RecomRestfulController.java
  33. 1 1
      src/main/java/com/seec/bok/recommend/vo/AnswerTQ.java
  34. 1 1
      src/main/java/com/seec/bok/recommend/vo/NoAnswerTQ.java
  35. 23 0
      src/main/java/com/seec/bok/web/controller/KnowledgeController.java
  36. 59 0
      src/main/java/com/seec/bok/web/controller/QuestionController.java
  37. 26 0
      src/main/java/com/seec/bok/web/controller/QuestionQueryController.java
  38. 39 0
      src/main/java/com/seec/bok/web/controller/RecordController.java
  39. 48 0
      src/main/java/com/seec/bok/web/controller/UserInteractiveController.java
  40. 9 0
      src/main/java/com/seec/bok/web/dto/CollectDTO.java
  41. 13 0
      src/main/java/com/seec/bok/web/dto/PageDTO.java
  42. 10 0
      src/main/java/com/seec/bok/web/dto/RateDTO.java
  43. 16 0
      src/main/java/com/seec/bok/web/dto/RecordDTO.java
  44. 58 0
      src/main/java/com/seec/bok/web/util/FakeQuestionData.java
  45. 32 0
      src/main/java/com/seec/bok/web/util/FakeRecordData.java
  46. 18 0
      src/main/java/com/seec/bok/web/vo/KnowledgeNodeVO.java
  47. 14 0
      src/main/java/com/seec/bok/web/vo/PageVO.java
  48. 14 0
      src/main/java/com/seec/bok/web/vo/PageableQuestionListVO.java
  49. 28 0
      src/main/java/com/seec/bok/web/vo/QuestionVO.java
  50. 19 0
      src/main/java/com/seec/bok/web/vo/RecordVO.java
  51. 14 0
      src/main/java/com/seec/bok/web/vo/constant/QuestionType.java
  52. 3 1
      src/main/resources/application.properties
  53. 5 5
      src/test/java/com/seec/bok/QuestionTests.java

+ 6 - 0
.gitignore

@@ -29,3 +29,9 @@ build/
 
 ### VS Code ###
 .vscode/
+### pythoon ###
+tagged
+pdf
+node_modules
+nodejs/root/
+tagged.zip

BIN
nodejs/image3.png


+ 191 - 0
nodejs/learncoder.js

@@ -0,0 +1,191 @@
+
+// "id" : "1009",
+// "type" : "choice",
+// "stem" : "计算机感染特洛伊木马后的典型现象是( )。",
+// "options" : {
+//   "A" : "程序异常退出",
+//   "B" : "有未知程序试图建立网络连接",
+//   "C" : "邮箱被垃圾邮件填满",
+//   "D" : "Windows 系统黑屏"
+// },
+// "answer" : "B",
+// "key_points" : "空",
+// "analysis" : "计算机感染特洛伊木马后,会受到特洛伊木马程序的控制,有以下几种典型现象。●有未知程序试图建立网络连接。●系统中有可疑的进程在运行等现象。●系统运行速度越来越慢,且CPU资源占用率高。●任务表中有可疑的文件在运行。●系统长时间读/写硬盘或搜索软盘。●系统经常死机或重启等。",
+// "tags" : null,
+// "knowledgeId" : [ "CF.NCB", "CF.SSDM" ],
+// "lastModified" : "2020-03-11 19:29:37",
+var request = require("request");
+var fs = require('fs');
+let startNum=0;
+var options = {
+    url:'https://zhjts.learncoder.com:5555/question/api/v1/category/get/exercise?categoryId='+startNum
+};
+
+
+function get(opts) {
+    return new Promise ((resolve, reject) => {
+        request.get(opts,function(err,response,body){
+            if(!err && response.statusCode == 200){
+                if(body!=='null'){
+                    results=JSON.parse(body);
+                    resolve(results);
+                }
+            }
+        });    
+    });
+}
+canhoice=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
+questionType = {
+    "1":"choice",
+    "0":"true_false",
+    "2":"multiple_choice",
+    "3":"blank",
+    "4":"short_answer"
+}
+var categoryList=[];
+categoryList.push({
+    id:0,
+    name: "练习",
+    parentId: 0,
+    hasChild: true,
+    orderNum: 0,
+    hasNew: false
+});
+var totalList=[];
+
+let pormis= crawler(categoryList);
+pormis.then(result=>{
+    console.log(totalList.length);
+    let obj = {
+        "totalList": totalList,
+        "length": totalList.length
+    };
+    fs.writeFileSync('output.json', JSON.stringify(obj));
+})
+
+ 
+
+//使用它
+async function crawler(categoryList) {
+    // console.log(categoryList[categoryList.length-1].name)
+    let result = await get(buildCateOptions(categoryList[categoryList.length-1].id));
+    for(let i of result.res){
+        categoryList.push(i);
+        
+        if(i.hasChild){
+            await crawler(categoryList);
+        }else{
+            let key_points="知识点";
+            for(let cate of categoryList){
+                key_points=key_points+"."+cate.name;
+            }
+            // totalList.push(key_points);
+            let retlist = await getQuestion(i.id,key_points);
+            for(let j of retlist){
+                totalList.push(j);
+            }
+            
+        }
+        categoryList.pop();
+    }
+    
+    return result;
+}
+function buildQuestionOptions(id){
+    let option = {
+        url:'https://zhjts.learncoder.com:5555/question/api/v1/exercise/questions/get/auth?page=0&size=1000&categoryId='+id
+    };
+    return option;
+}
+
+// getQuestion(94,"112231");
+
+async function getQuestion(id,key_points){
+    let retList=[]
+    let res = await get(buildQuestionOptions(id));
+    for(let q of res.res.data){
+        let newQ={
+        };
+        newQ.id="learncoder_"+id+"_"+q.id;
+        newQ.stem=q.stem;
+        newQ.key_points=key_points;
+        if(q.analysis===null||q.analysis=="[analysis]空"){
+            newQ.analysis='空';
+        }else{
+            newQ.analysis=q.analysis.replace("[analysis]","").replace("【考点】","");;
+        }
+        newQ.type=questionType[''+q.questionType];
+        let ind;
+        switch(q.questionType){
+            case 0://判断题
+            newQ.answer=q.answer;
+            break;
+            case 1://选择题
+                newQ.options={}
+                newQ.answer="";
+                ind=0;
+                for(let opt of q.options){
+                    let choice =canhoice[ind];
+                    ind++;
+                    let content= opt.content;
+                    if(opt.content.charAt(1)=='.'){
+                        choice = opt.content.slice(0,1)
+                        content= opt.content.slice(2)
+                    }
+
+                    newQ.options[choice]=content;
+                    if(opt.correct){
+                        newQ.answer=choice;
+                    }
+                    
+                }
+                break;
+            case 2://多选题
+                newQ.options={}
+                newQ.answer="";
+                ind=0;
+                for(let opt of q.options){
+                    let choice =canhoice[ind];
+                    ind++;
+                    let content= opt.content;
+                    if(opt.content.charAt(1)=='.'){
+                        choice = opt.content.slice(0,1)
+                        content= opt.content.slice(2)
+                    }
+                    newQ.options[choice]=content;
+                    if(opt.correct){
+                        newQ.answer=newQ.answer+";"+choice;
+                    }
+                }
+                newQ.answer=newQ.answer.slice(1);
+                break;
+            case 3://填空题
+                newQ.options={}
+                q.answer="";
+                for(let opt of q.blanks){
+                    let choice = opt.blankId    
+                    let content= opt.blankAnswer[0]
+                    newQ.options[choice]=content;
+                }
+                q.answer=q.answer.slice(1);
+                break;
+            case 4://简答题
+                newQ.answer=q.answer.replace("[answer_question_answer]","")
+                break;
+            default:
+                console.log(q);
+                throw new Error('questionType error='+q.questionType);
+
+        }
+        retList.push(newQ);
+    }
+    // console.log(retList);
+    return retList;
+}
+
+function buildCateOptions(id){
+    let option = {
+        url:'https://zhjts.learncoder.com:5555/question/api/v1/category/get/exercise?categoryId='+id
+    };
+    return option;
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
nodejs/output.json


+ 337 - 0
nodejs/package-lock.json

@@ -0,0 +1,337 @@
+{
+  "requires": true,
+  "lockfileVersion": 1,
+  "dependencies": {
+    "ajv": {
+      "version": "6.12.0",
+      "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.0.tgz?cache=0&sync_timestamp=1582379612319&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.0.tgz",
+      "integrity": "sha1-BtYLlth7hFSlrauobnhU2mKdtLc=",
+      "requires": {
+        "fast-deep-equal": "^3.1.1",
+        "fast-json-stable-stringify": "^2.0.0",
+        "json-schema-traverse": "^0.4.1",
+        "uri-js": "^4.2.2"
+      }
+    },
+    "asn1": {
+      "version": "0.2.4",
+      "resolved": "https://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz",
+      "integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=",
+      "requires": {
+        "safer-buffer": "~2.1.0"
+      }
+    },
+    "assert-plus": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz",
+      "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
+    },
+    "asynckit": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz",
+      "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
+    },
+    "aws-sign2": {
+      "version": "0.7.0",
+      "resolved": "https://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz",
+      "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
+    },
+    "aws4": {
+      "version": "1.9.1",
+      "resolved": "https://registry.npm.taobao.org/aws4/download/aws4-1.9.1.tgz",
+      "integrity": "sha1-fjPY99RJs/ZzzXLeuavcVS2+Uo4="
+    },
+    "bcrypt-pbkdf": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz",
+      "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
+      "requires": {
+        "tweetnacl": "^0.14.3"
+      }
+    },
+    "caseless": {
+      "version": "0.12.0",
+      "resolved": "https://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz",
+      "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
+    },
+    "combined-stream": {
+      "version": "1.0.8",
+      "resolved": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz",
+      "integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=",
+      "requires": {
+        "delayed-stream": "~1.0.0"
+      }
+    },
+    "core-util-is": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz",
+      "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
+    },
+    "dashdash": {
+      "version": "1.14.1",
+      "resolved": "https://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz",
+      "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
+      "requires": {
+        "assert-plus": "^1.0.0"
+      }
+    },
+    "delayed-stream": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz",
+      "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
+    },
+    "ecc-jsbn": {
+      "version": "0.1.2",
+      "resolved": "https://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz",
+      "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
+      "requires": {
+        "jsbn": "~0.1.0",
+        "safer-buffer": "^2.1.0"
+      }
+    },
+    "extend": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz",
+      "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo="
+    },
+    "extsprintf": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz",
+      "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
+    },
+    "fast-deep-equal": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.1.tgz",
+      "integrity": "sha1-VFFFB3xQFJHjOxXsQIwpQ3bpSuQ="
+    },
+    "fast-json-stable-stringify": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz",
+      "integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM="
+    },
+    "forever-agent": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz",
+      "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
+    },
+    "form-data": {
+      "version": "2.3.3",
+      "resolved": "https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz?cache=0&sync_timestamp=1573027118125&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fform-data%2Fdownload%2Fform-data-2.3.3.tgz",
+      "integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=",
+      "requires": {
+        "asynckit": "^0.4.0",
+        "combined-stream": "^1.0.6",
+        "mime-types": "^2.1.12"
+      }
+    },
+    "getpass": {
+      "version": "0.1.7",
+      "resolved": "https://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz",
+      "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
+      "requires": {
+        "assert-plus": "^1.0.0"
+      }
+    },
+    "har-schema": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz",
+      "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
+    },
+    "har-validator": {
+      "version": "5.1.3",
+      "resolved": "https://registry.npm.taobao.org/har-validator/download/har-validator-5.1.3.tgz",
+      "integrity": "sha1-HvievT5JllV2de7ZiTEQ3DUPoIA=",
+      "requires": {
+        "ajv": "^6.5.5",
+        "har-schema": "^2.0.0"
+      }
+    },
+    "http-signature": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz",
+      "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
+      "requires": {
+        "assert-plus": "^1.0.0",
+        "jsprim": "^1.2.2",
+        "sshpk": "^1.7.0"
+      }
+    },
+    "is-typedarray": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz",
+      "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
+    },
+    "isstream": {
+      "version": "0.1.2",
+      "resolved": "https://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz",
+      "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
+    },
+    "jsbn": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz",
+      "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
+    },
+    "json-schema": {
+      "version": "0.2.3",
+      "resolved": "https://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz",
+      "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
+    },
+    "json-schema-traverse": {
+      "version": "0.4.1",
+      "resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz",
+      "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA="
+    },
+    "json-stringify-safe": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz?cache=0&sync_timestamp=1573614722142&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson-stringify-safe%2Fdownload%2Fjson-stringify-safe-5.0.1.tgz",
+      "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
+    },
+    "jsprim": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz",
+      "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
+      "requires": {
+        "assert-plus": "1.0.0",
+        "extsprintf": "1.3.0",
+        "json-schema": "0.2.3",
+        "verror": "1.10.0"
+      }
+    },
+    "mime-db": {
+      "version": "1.43.0",
+      "resolved": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.43.0.tgz?cache=0&sync_timestamp=1578281136306&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime-db%2Fdownload%2Fmime-db-1.43.0.tgz",
+      "integrity": "sha1-ChLgUCZQ5HPXNVNQUOfI9OtPrlg="
+    },
+    "mime-types": {
+      "version": "2.1.26",
+      "resolved": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.26.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime-types%2Fdownload%2Fmime-types-2.1.26.tgz",
+      "integrity": "sha1-nJIfwJt+FJpl39wNpNIJlyALCgY=",
+      "requires": {
+        "mime-db": "1.43.0"
+      }
+    },
+    "oauth-sign": {
+      "version": "0.9.0",
+      "resolved": "https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz",
+      "integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU="
+    },
+    "performance-now": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz",
+      "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
+    },
+    "psl": {
+      "version": "1.7.0",
+      "resolved": "https://registry.npm.taobao.org/psl/download/psl-1.7.0.tgz",
+      "integrity": "sha1-8cTEeo75cWfepda79IFtc26ISjw="
+    },
+    "punycode": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz",
+      "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew="
+    },
+    "qs": {
+      "version": "6.5.2",
+      "resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz",
+      "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY="
+    },
+    "request": {
+      "version": "2.88.2",
+      "resolved": "https://registry.npm.taobao.org/request/download/request-2.88.2.tgz",
+      "integrity": "sha1-1zyRhzHLWofaBH4gcjQUb2ZNErM=",
+      "requires": {
+        "aws-sign2": "~0.7.0",
+        "aws4": "^1.8.0",
+        "caseless": "~0.12.0",
+        "combined-stream": "~1.0.6",
+        "extend": "~3.0.2",
+        "forever-agent": "~0.6.1",
+        "form-data": "~2.3.2",
+        "har-validator": "~5.1.3",
+        "http-signature": "~1.2.0",
+        "is-typedarray": "~1.0.0",
+        "isstream": "~0.1.2",
+        "json-stringify-safe": "~5.0.1",
+        "mime-types": "~2.1.19",
+        "oauth-sign": "~0.9.0",
+        "performance-now": "^2.1.0",
+        "qs": "~6.5.2",
+        "safe-buffer": "^5.1.2",
+        "tough-cookie": "~2.5.0",
+        "tunnel-agent": "^0.6.0",
+        "uuid": "^3.3.2"
+      }
+    },
+    "safe-buffer": {
+      "version": "5.2.0",
+      "resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.0.tgz",
+      "integrity": "sha1-t02uxJsRSPiMZLaNSbHoFcHy9Rk="
+    },
+    "safer-buffer": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz",
+      "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo="
+    },
+    "sshpk": {
+      "version": "1.16.1",
+      "resolved": "https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz",
+      "integrity": "sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=",
+      "requires": {
+        "asn1": "~0.2.3",
+        "assert-plus": "^1.0.0",
+        "bcrypt-pbkdf": "^1.0.0",
+        "dashdash": "^1.12.0",
+        "ecc-jsbn": "~0.1.1",
+        "getpass": "^0.1.1",
+        "jsbn": "~0.1.0",
+        "safer-buffer": "^2.0.2",
+        "tweetnacl": "~0.14.0"
+      }
+    },
+    "tough-cookie": {
+      "version": "2.5.0",
+      "resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz",
+      "integrity": "sha1-zZ+yoKodWhK0c72fuW+j3P9lreI=",
+      "requires": {
+        "psl": "^1.1.28",
+        "punycode": "^2.1.1"
+      }
+    },
+    "tunnel-agent": {
+      "version": "0.6.0",
+      "resolved": "https://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz",
+      "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
+      "requires": {
+        "safe-buffer": "^5.0.1"
+      }
+    },
+    "tweetnacl": {
+      "version": "0.14.5",
+      "resolved": "https://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz?cache=0&sync_timestamp=1581365004105&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftweetnacl%2Fdownload%2Ftweetnacl-0.14.5.tgz",
+      "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
+    },
+    "uri-js": {
+      "version": "4.2.2",
+      "resolved": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz",
+      "integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=",
+      "requires": {
+        "punycode": "^2.1.0"
+      }
+    },
+    "uuid": {
+      "version": "3.4.0",
+      "resolved": "https://registry.npm.taobao.org/uuid/download/uuid-3.4.0.tgz",
+      "integrity": "sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4="
+    },
+    "verror": {
+      "version": "1.10.0",
+      "resolved": "https://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz",
+      "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
+      "requires": {
+        "assert-plus": "^1.0.0",
+        "core-util-is": "1.0.2",
+        "extsprintf": "^1.2.0"
+      }
+    }
+  }
+}

+ 82 - 0
nodejs/pic.js

@@ -0,0 +1,82 @@
+var fs = require('fs');
+var request = require("request");
+var path = require('path');
+
+var src = "https://miscrofile.oss-cn-hangzhou.aliyuncs.com/root/question/data_structure2020/2020数据结构(第2章)/image3.png";
+
+content=fs.readFileSync("output.json", "utf8");
+list1 = content.match(/https:\/\/miscrofile.oss-cn-hangzhou.aliyuncs.com\/([^.]+)\.([a-zA-Z0-9]+)/g);
+list2 = content.match(/https:\/\/miscrofile.oss-cn-hangzhou.aliyuncs.com/g);
+
+writeFile(list1,0,null)
+function writeFile(uriList,num){
+    let uri=uriList[num];
+    let pathString=uri.replace("https://miscrofile.oss-cn-hangzhou.aliyuncs.com/","");
+    dir=pathString.replace(/([^\/]+)\.([a-zA-Z0-9]+)/,"");
+    if(dir.charAt(dir.length-1)==="/"){
+        dir=dir.slice(0,dir.length-1)
+    }
+    mkdirsSync(dir);
+    if(fs.existsSync(pathString)){
+        // console.log("N:"+num+" 已经存在");
+        num++;
+        if(num<uriList.length){
+            writeFile(uriList,num);
+        }
+        return;
+    }
+    let writeStream = fs.createWriteStream(pathString);
+    let option={
+        url:encodeURI(uri),
+        headers: {
+            "Referer": "http://neep.learncoder.com/content/practice/practice?id=116&name=%E7%BD%91%E7%BB%9C%E5%B1%82",
+            "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"
+        },
+    }
+    let readStream = request(option)
+    
+    readStream.pipe(writeStream);
+    readStream.on('end', function() {
+        // console.log('文件下载成功');
+    });
+    readStream.on('error', function(err) {
+        console.log("N:"+num+" 失败 "+err);
+        num++;
+        if(num<uriList.length){
+            writeFile(uriList,num);
+        }
+    })
+    writeStream.on("finish", function() {
+        console.log("N:"+num+" 成功 "+uri);
+        writeStream.end();
+        num++;
+        if(num<uriList.length){
+            writeFile(uriList,num);
+        }
+    });
+}
+
+
+// let writeStream = fs.createWriteStream('image.png');
+// let readStream = request(option)
+// readStream.pipe(writeStream);
+// readStream.on('end', function() {
+//     console.log('文件下载成功');
+// });
+// readStream.on('error', function(err) {
+//     console.log("错误信息:" + err)
+// })
+// writeStream.on("finish", function() {
+//     console.log("文件写入成功");
+//     writeStream.end();
+// });
+function mkdirsSync(dirname) {
+    if (fs.existsSync(dirname)) {
+      return true;
+    } else {
+      if (mkdirsSync(path.dirname(dirname))) {
+        fs.mkdirSync(dirname);
+        return true;
+      }
+    }
+  }

+ 16 - 0
pom.xml

@@ -35,6 +35,11 @@
             <groupId>org.springframework.hateoas</groupId>
             <artifactId>spring-hateoas</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springdoc</groupId>
+            <artifactId>springdoc-openapi-webflux-ui</artifactId>
+            <version>1.2.33</version>
+        </dependency>
         <!--<dependency>-->
             <!--<groupId>org.springframework.restdocs</groupId>-->
             <!--<artifactId>tot</artifactId>-->
@@ -77,6 +82,17 @@
             <!--<version>5.2.4</version>-->
         <!--</dependency>-->
 
+        <dependency>
+            <groupId>org.apache.pdfbox</groupId>
+            <artifactId>pdfbox-tools</artifactId>
+            <version>2.0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>net.sf.cssbox</groupId>
+            <artifactId>pdf2dom</artifactId>
+            <version>1.6</version>
+        </dependency>
+
         <dependency>
             <groupId>org.springframework.restdocs</groupId>
             <artifactId>spring-restdocs-mockmvc</artifactId>

BIN
python/SvmClassifier.model


BIN
python/__pycache__/const.cpython-38.pyc


BIN
python/__pycache__/load_data.cpython-38.pyc


+ 394 - 0
python/const.py

@@ -0,0 +1,394 @@
+category_labels={
+	"SR.RA.SoftwareRS": "软件需求规约",
+	"SR.RV": "需求验证",
+	"SR.RV.RR": "需求评审",
+	"SR.RV.P": "原型法",
+	"SR.RV.MV": "模型验证",
+	"SR.RV.AT": "接受性测试",
+	"SR.RC": "软件需求-实际考虑",
+	"SR.RV.INRP": "需求过程的迭代本质",
+	"SR.RV.CM": "变更管理",
+	"SR.RV.RA": "需求属性",
+	"SR.RV.RT": "需求追踪",
+	"SR.RV.MR": "度量需求",
+	"SR.SRT": "软件需求工具",
+	"SD": "软件设计",
+	"SD.SDF": "软件设计基础",
+	"SD.SDF.GDC": "通用设计概念",
+	"SD.SDF.CSD": "软件设计情境",
+	"SD.SDF.SDProcess": "软件设计过程",
+	"SD.SDF.SDPrinciples": "软件设计原理",
+	"SD.SSA": "软件体系结构",
+	"SD.SSA.ASV": "体系结构的结构与视图",
+	"SD.SSA.AS": "体系结构的风格",
+	"SD.SSA.DP": "设计模式",
+	"SD.SSA.ADD": "体系结构设计决策",
+	"SD.SSA.FPF": "程序族与架构",
+	"SD.SDN": "软件设计符号",
+	"SD.SDN.BDSV": "结构化描述(静态视图)",
+	"SD.SDN.BDDV": "行为描述(动态视图)",
+	"SD.SDSM": "软件设计策略与方法",
+	"SD.SDSM.GS": "软件设计的通用策略",
+	"SD.SDSM.FOSD": "面向功能的(结构化的)设计",
+	"SD.SDSM.OOD": "面向对象的设计",
+	"SD.SDSM.DSCD": "以数据结构为中心的设计",
+	"SD.SDSM.CBD": "基于组件的设计",
+	"SD.SDSM.OM": "其他设计策略和方法",
+	"SD.KISD": "软件设计的关键问题",
+	"SD.KISD.C": "并发性",
+	"SD.KISD.CHE": "事件的控制与处理",
+	"SD.KISD.DP": "数据持久性",
+	"SD.KISD.DC": "组件的分布",
+	"SD.KISD.EEHFT": "错误、异常处理与容错",
+	"SD.KISD.IP": "交互与表现",
+	"SD.KISD.S": "安全性",
+	"SD.SDT": "软件设计工具",
+	"SC": "软件构造",
+	"SC.SCF": "软件构造基础",
+	"SC.SCF.MC": "最小化复杂性",
+	"SC.SCF.AC": "预测变更",
+	"SC.SCF.CV": "为验证而构造",
+	"SC.SCF.R": "复用",
+	"SC.SCF.SC": "构造标准",
+	"SC.MC": "管理软件构造",
+	"SC.MC.CLCM": "生命周期模型中的构造",
+	"SC.MC.CP": "构造规划",
+	"SC.MC.CM": "构造度量",
+	"SC.PC": "软件构造-实际考虑",
+	"SC.PC.CD": "构造设计",
+	"SC.PC.CL": "构造语言",
+	"SC.PC.C": "代码编写",
+	"SC.PC.CT": "构造测试",
+	"SC.PC.CforR": "面向复用的构造",
+	"SC.PC.CwithR": "基于复用的构造",
+	"SC.PC.CQ": "构造质量",
+	"SC.PC.I": "集成",
+	"SC.CT": "构造技术",
+	"SC.CT.ADU": "API设计与应用",
+	"SC.CT.OORI": "面向对象的运行态问题",
+	"SC.CT.PG": "参数化与泛化",
+	"SC.CT.ADCDP": "断言、契约式设计、防御式编程",
+	"SC.CT.EHEHFT": "错误处理、异常处理与容错",
+	"SC.CT.EM": "可执行模型",
+	"SC.CT.SBTDCT": "基于状态和表驱动的构造技术",
+	"SC.CT.RCI": "运行态配置与国际化",
+	"SC.CT.GBIP": "基于语法的输入处理",
+	"SC.CT.CP": "并发源语",
+	"SC.CT.M": "中间件",
+	"SC.CT.CMDS": "分布式软件构造方法",
+	"SC.CT.CHS": "构造异构系统",
+	"SC.CT.PAT": "性能分析与代码调整",
+	"SC.CT.PS": "平台标准",
+	"SC.CT.TFP": "测试优先的编程",
+	"SC.SCT": "软件构造工具",
+	"SC.SCT.DE": "软件开发环境",
+	"SC.SCT.GUI": "GUI构造器",
+	"SC.SCT.UTT": "单元测试工具",
+	"ST.TT.TBNA": "基于应用性质的测试",
+	"ST.TT.SCT": "测试技术的选择与组合",
+	"ST.TRM": "测试相关测量",
+	"ST.TRM.EPUT": "测试中的程序评价",
+	"ST.TRM.ETP": "测试执行的评价",
+	"ST.TP": "测试过程",
+	"ST.TP.PC": "测试过程-实际考虑",
+	"ST.TP.TA": "测试活动",
+	"ST.STT": "软件测试工具",
+	"ST.STT.TTS": "测试支持工具",
+	"ST.STT.CT": "测试工具分类",
+	"SM": "软件维护",
+	"SM.SMF": "软件维护基础",
+	"SM.SMF.DT": "定义和术语",
+	"SM.SMF.NatureM": "软件维护的本质",
+	"SM.SMF.NeedM": "软件维护的需要",
+	"SM.SMF.MMC": "主要维护成本",
+	"SM.SMF.ES": "软件演化",
+	"SM.SMF.CM": "软件维护分类",
+	"SM.KISM": "软件维护关键问题",
+	"SM.KISM.TI": "技术问题",
+	"SM.KISM.MI": "管理问题",
+	"SM.KISM.MCE": "维护成本预估",
+	"SM.KISM.SMM": "软件维护度量",
+	"SM.MP": "维护过程",
+	"SM.MP.MP": "维护过程-维护过程",
+	"SM.MP.MA": "维护活动",
+	"SM.TM": "维护技术",
+	"SM.TM.PC": "程序理解",
+	"SM.TM.Reengineering": "再工程",
+	"SM.TM.RE": "逆向工程",
+	"SM.TM.M": "迁移",
+	"SM.TM.Retirement": "软件退役",
+	"SM.SMT": "软件维护工具",
+	"SCM": "软件配置管理",
+	"SCM.MSP": "软件配置管理过程的管理",
+	"SCM.MSP.QCS": "软件配置管理组织情景",
+	"SCM.MSP.CGSP": "软件配置管理过程约束与指南",
+	"SCM.MSP.PS": "软件配置管理规划",
+	"SCM.MSP.SP": "软件配置管理文档",
+	"SCM.MSP.SS": "软件配置管理监督",
+	"SCM.SCI": "软件配置标识",
+	"SCM.SCI.IIC": "识别受控制项",
+	"SCM.SCI.SL": "软件库",
+	"SCM.SCC": "软件配置控制",
+	"SCM.SCC.REASC": "请求、评价与批准软件变更",
+	"SCM.SCC.ISC": "实施软件变更",
+	"SCM.SCC.DW": "偏离与弃权",
+	"SCM.SCSA": "软件配置状态核定",
+	"SCM.SCSA.SCSI": "软件配置状态信息",
+	"SCM.SCSA.": "软件配置状态报告",
+	"SCM.SCA": "软件配置审计",
+	"SCM.SCA.SFCA": "软件功能配置审计",
+	"SCM.SCA.SPCA": "软件物理配置审计",
+	"SCM.SCA.IPASB": "软件基线的过程内审计",
+	"SCM.SRMD": "软件发布管理与交付",
+	"SCM.SRMD.SB": "软件发布管理与交付-软件构造",
+	"SCM.SRMD.SRM": "软件发布管理",
+	"SCM.SCMT": "软件配置管理工具",
+	"SEM": "软件工程管理",
+	"SEM.ISD": "初始化和范围定义",
+	"SEM.ISD.DNR": "需求协商和确定",
+	"SEM.ISD.FA": "可行性的分析",
+	"SEM.ISD.PRRR": "需求审查和修订的流程",
+	"SEM.SPP": "软件项目规划",
+	"SEM.SPP.PP": "过程设计",
+	"SEM.SPP.DD": "确定可交付软件构件",
+	"SEM.SPP.ESCE": "成果、时间表和成本估计",
+	"SEM.SPP.RA": "资源分配",
+	"SEM.SPP.RM": "风险管理",
+	"SEM.SPP.QM": "质量管理",
+	"SEM.SPP.PM": "计划管理",
+	"SEM.SPE": "软件项目执行",
+	"SEM.SPE.IP": "设计实施",
+	"SEM.SPE.SASCM": "软件供需合同管理",
+	"SEM.SPE.IMP": "测量过程实施",
+	"SEM.SPE.MP": "监控过程",
+	"SEM.SPE.CP": "过程控制",
+	"SEM.SPE.R": "报告",
+	"SEM.RE": "审查和评估",
+	"SEM.RE.DSR": "需求满意度的判定",
+	"SEM.RE.REP": "审查和评估的表现",
+	"SEM.C": "结束",
+	"SEM.C.DC": "结束判定",
+	"SEM.C.CA": "结束活动",
+	"SEM.SEMeasurement": "软件工程测量",
+	"SEM.SEM.ESMC": "建立和维持测量义务",
+	"SEM.SEM.PlanMP": "规划测量过程",
+	"SEM.SEM.PerformMP": "执行测量过程",
+	"SEM.SEM.EM": "评估测量",
+	"SEM.SEM": "软件工程管理工具",
+	"SEP": "软件工程过程",
+	"SEP.SPD": "软件过程定义",
+	"SEP.SPD.SPM": "软件过程管理",
+	"SEP.SPD.SPI": "软件过程基础设施",
+	"SEP.SLC": "软件生命周期",
+	"SEP.SLC.CSP": "软件过程分类",
+	"SEP.SLC.SLCM": "软件生命周期模型",
+	"SEP.SLC.SPA": "软件过程的适应",
+	"SEP.SLC.PC": "实际考虑因素",
+	"SEP.SPAI": "软件过程的评估和改进",
+	"SEP.SPAI.SPAModels": "软件过程评估模型",
+	"SEP.SPAI.CSSPR": "持续性和阶段性软件过程评级",
+	"SEP.SM": "软件度量",
+	"SEP.SM.SPPM": "软件过程和产品的度量",
+	"SEP.SM.QMR": "度量结果的质量",
+	"SEP.SM.SIM": "软件信息模型",
+	"SEP.SM.SPMT": "软件过程度量技术",
+	"SEP.SEPT": "软件工程过程工具",
+	"SEMM": "软件工程模型与方法",
+	"SEMM.M": "建模方法",
+	"SEMM.M.MP": "建模原则",
+	"SEMM.M.PEM": "模型属性与表示",
+	"SEMM.M.SSP": "语法、语义和语用",
+	"SEMM.M.PPI": "前置条件、后置条件和不变量",
+	"SEMM.TM": "模型类型",
+	"SEMM.TM.IM": "信息模型",
+	"SEMM.TM.BM": "行为模型",
+	"SEMM.TM.SM": "结构模型",
+	"SEMM.AM": "模型分析",
+	"SEMM.AM.ACompleteness": "完整性分析",
+	"SEMM.AM.AConsistency": "一致性分析",
+	"SEMM.AM.Correctness": "正确性分析",
+	"SEMM.AM.T": "可追溯性分析",
+	"SEMM.AM.IA": "交互性分析",
+	"SEMM.SEM": "软件工程方法",
+	"SR": "软件需求",
+	"SE": "软件工程",
+	"SR.SRF": "软件需求基础",
+	"SR.SRF.DSR": "软件需求的定义",
+	"SR.SRF.PPR": "产品与过程需求",
+	"SR.SRF.FNR": "功能与非功能需求",
+	"SR.SRF.EP": "突发需求",
+	"SR.SRF.QR": "可量化需求",
+	"SR.SRF.SRSR": "系统需求与软件需求",
+	"SR.RP": "需求过程",
+	"SR.RP.PM": "过程模型",
+	"SC.SCT.PPAST": "性能分析工具",
+	"ST": "软件测试",
+	"SEP.SPAI.SPAMethods": "软件过程评估方法",
+	"SEP.SPAI.SPIM": "软件过程改进模型",
+	"SEMM.SEM.HM": "启发式方法",
+	"SEMM.SEM.FM": "形式化方法",
+	"SEMM.SEM.PM": "快速原型法",
+	"SEMM.SEM.AM": "敏捷开发方法",
+	"SEMM.SEM.EP": "模型驱动开发方法",
+	"SQ": "软件质量",
+	"SQ.SQF": "软件质量基础",
+	"SQ.SQF.SECE": "软件工程文化和伦理",
+	"SQ.SQF.VCQ": "质量的价值和成本",
+	"SQ.SQF.MQC": "模型和质量特征",
+	"SQ.SQF.SQI": "软件质量改进",
+	"SQ.SQF.SC": "软件安全",
+	"SQ.SQMP": "软件质量管理过程",
+	"SQ.SQMP.SQA": "软件质量保证",
+	"SQ.SQMP.VV": "检验和确认",
+	"SQ.SQMP.RA": "复核和审核",
+	"SQ.PC": "软件质量-实际考虑",
+	"SQ.PC.SQR": "软件质量需求",
+	"SQ.PC.DC": "缺陷特征",
+	"SQ.PC.SQMT": "软件质量管理技术",
+	"SQ.PC.SQM": "软件质量测量",
+	"SQ.SQT": "软件质量工具",
+	"SEPP": "软件工程职业实践",
+	"SEPP.P": "职业技能",
+	"SEPP.P.ACL": "鉴定,认证和许可",
+	"SEPP.P.CEPC": "职业道德与行为",
+	"SEPP.P.NRPS": "专业团队的本质和角色",
+	"SEPP.P.NRPSES": "软件工程标准的本质和作用",
+	"SEPP.P.EIS": "软件的经济效应",
+	"SEPP.P.EC": "雇佣合同",
+	"SEPP.P.LI": "法律问题",
+	"SEPP.P.D": "文档工作",
+	"SEPP.P.TA": "折中分析",
+	"SEPP.GDP": "团队动力与心理学",
+	"SEPP.GDP.DWT/G": "团队工作动力",
+	"SEPP.GDP.IC": "个体认知",
+	"SEPP.GDP.DPC": "处理问题复杂性",
+	"SEPP.GDP.IS": "与利益各方沟通",
+	"SEPP.GDP.DUA": "不确定性和模糊性处理",
+	"SEPP.GDP.DME": "多文化环境处理",
+	"SEPP.CS": "沟通技巧",
+	"SEPP.CS.RUS": "阅读、理解和概括",
+	"SEPP.CS.W": "写作技巧",
+	"SEPP.CS.TGC": "团队沟通",
+	"SEPP.CS.PS": "表达技巧",
+	"SEE": "软件工程经济学",
+	"SEE.SEEF": "软件工程经济学基础",
+	"SEE.SEEF.F": "金融",
+	"SEE.SEEF.A": "会计",
+	"SEE.SEEF.C": "管控",
+	"ST.STF": "软件测试基础",
+	"ST.STF.TRT": "测试相关术语",
+	"ST.STF.KI": "软件测试关键问题",
+	"ST.STF.RTOA": "测试与其他活动的关系",
+	"ST.TL": "测试级别",
+	"ST.TL.TTT": "测试对象",
+	"ST.TL.OT": "测试目标",
+	"ST.TT": "测试技术",
+	"ST.TT.BSEIE": "基于软件工程师直觉和经验的测试",
+	"ST.TT.IDBT": "基于输入域的测试",
+	"ST.TT.CBT": "基于代码的测试",
+	"ST.TT.FBT": "基于故障的测试",
+	"ST.TT.UBT": "基于使用的测试",
+	"ST.TT.MBT": "基于模型的测试",
+	"SEE.SEEF.CF": "现金流",
+	"SEE.SEEF.DMP": "决策过程",
+	"SEE.SEEF.V": "估价",
+	"SEE.SEEF.I": "通货膨胀",
+	"SEE.SEEF.D": "贬值",
+	"SEE.SEEF.T": "税收",
+	"SEE.SEEF.TVM": "货币的时间价值",
+	"SEE.SEEF.Efficiency": "效率",
+	"SEE.SEEF.Effectiveness": "有效性",
+	"SEE.SEEF.P": "生产率",
+	"SEE.LCE": "生命周期经济学",
+	"SEE.LCE.Product": "产品",
+	"SEE.LCE.Project": "项目",
+	"SEE.LCE.Program": "程序",
+	"SEE.LCE.Portfolio": "组合",
+	"SEE.LCE.ProductLC": "产品生命周期",
+	"SEE.LCE.ProjectLC": "项目生命周期",
+	"SEE.LCE.Proposals": "提案",
+	"SEE.LCE.ID": "投资决策",
+	"SEE.LCE.PH": "规划区间",
+	"SEE.LCE.PP": "价格和定价",
+	"SEE.LCE.CC": "费用与成本",
+	"SEE.LCE.PM": "性能测试",
+	"SEE.LCE.EVM": "挣值管理",
+	"SEE.LCE.TD": "结束决策",
+	"SEE.LCE.RRD": "替换与退休决策",
+	"SEE.RU": "风险与不确定性",
+	"SEE.RU.GEP": "目标、评估与规划",
+	"SEE.RU.ET": "评估技术",
+	"SEE.RU.AU": "解决不确定性",
+	"SEE.RU.P": "优先次序",
+	"SEE.RU.DR": "风险情况下的决策",
+	"SEE.RU.DU": "不确定情况下的决策",
+	"SEE.EAM": "经济分析方法",
+	"SEE.EAM.FPDA": "以盈利为目的的决策分析",
+	"SEE.EAM.MARR": "最小可接受收益率",
+	"SEE.EAM.RI": "投资回报率",
+	"SEE.EAM.RCE": "已投资资本回报率",
+	"SEE.EAM.CBA": "成本收益分析",
+	"SEE.EAM.CEA": "成本效益分析",
+	"SEE.EAM.BEA": "保本分析",
+	"SEE.EAM.BC": "商业案例",
+	"SEE.EAM.MAE": "多属性评价",
+	"SEE.EAM.QA": "优化分析",
+	"SEE.PC": "软件工程经济学-实际考虑",
+	"SEE.PC.TGEP": "“足够好”原则",
+	"SEE.PC.FFE": "非摩擦经济",
+	"SEE.PC.E": "生态系统",
+	"SEE.PC.OO": "离岸和外包",
+	"CF": "计算基础",
+	"CF.PST": "问题求解技巧",
+	"CF.A": "抽象化",
+	"CF.PF": "程序设计基础",
+	"CF.PLB": "编程语言基础知识",
+	"CF.DTT": "调试工具和技巧",
+	"CF.DSR": "数据结构和数据表示",
+	"CF.AC": "算法及其复杂性",
+	"CF.BCS": "系统的基本概念",
+	"CF.CQ": "计算机组织",
+	"CF.QSB": "编译基础",
+	"CF.CB": "操作系统基础",
+	"CF.DBDM": "数据库基础知识",
+	"CF.NCB": "网络通信基础",
+	"CF.PDC": "并行和分布式计算",
+	"CF.BUHF": "基本用户的人因素",
+	"CF.BDHF": "基础开发者的人因素",
+	"CF.SSDM": "安全软件开发和维护",
+	"MF": "数学基础",
+	"MF.SRF": "集合、关系、函数",
+	"MF.BL": "逻辑基础",
+	"MF.PT": "证明技巧",
+	"MF.BC": "计数基础",
+	"MF.GT": "图和数",
+	"MF.DP": "离散概率",
+	"MF.FSM": "有限状态机",
+	"MF.G": "文法",
+	"MF.NPAE": "数值精度、准确性、误差",
+	"MF.NT": "数论",
+	"MF.AS": "代数结构",
+	"EF": "工程基础",
+	"EF.EMET": "实证方法与实验技术",
+	"EF.SA": "统计分析",
+	"EF.M": "测量",
+	"EF.ED": "工程设计",
+	"EF.ESP": "建模、仿真与原型",
+	"EF.S": "标准",
+	"EF.RCA": "根本原因",
+	"SR.RP.PA": "过程参与者",
+	"SR.RP.SPM": "过程支持与管理",
+	"SR.RP.PQI": "过程管理与改进",
+	"SR.RE": "需求捕获",
+	"SR.RE.RS": "需求来源",
+	"SR.RE.ET": "捕获技术",
+	"SR.RA": "需求分析",
+	"SR.RA.RC": "需求分类",
+	"SR.RA.CM": "概念建模",
+	"SR.RA.ADRA": "体系结构设计与需求分类",
+	"SR.RA.RN": "需求协商",
+	"SR.RA.FA": "形式化分析",
+	"SR.RS": "需求规约",
+	"SR.RA.SDD": "系统定义文档",
+	"SR.RA.SystemRS": "系统需求规约"
+}

+ 4106 - 0
python/dict/stop_words.txt

@@ -0,0 +1,4106 @@
+
+ 
+stem
+answer
+analysis
+options
+A
+B
+C
+D
+E
+F
+G
+H
+I
+J
+K
+L
+M
+N
+O
+P
+Q
+R
+S
+T
+U
+V
+W
+X
+Y
+Z
+true
+false
+https
+seec
+oss
+cn
+beijing
+aliyuncs
+com
+AE
+BE
+AE
+media
+image
+png
+啊
+阿
+哎
+哎呀
+哎哟
+唉
+俺
+俺们
+按
+按照
+吧
+吧哒
+把
+罢了
+被
+本
+本着
+比
+比方
+比如
+鄙人
+彼
+彼此
+边
+别
+别的
+别说
+并
+并且
+不比
+不成
+不单
+不但
+不独
+不管
+不光
+不过
+不仅
+不拘
+不论
+不怕
+不然
+不如
+不特
+不惟
+不问
+不只
+朝
+朝着
+趁
+趁着
+乘
+冲
+除
+除此之外
+除非
+除了
+此
+此间
+此外
+从
+从而
+打
+待
+但
+但是
+当
+当着
+到
+得
+的
+的话
+等
+等等
+地
+第
+叮咚
+对
+对于
+多
+多少
+而
+而况
+而且
+而是
+而外
+而言
+而已
+尔后
+反过来
+反过来说
+反之
+非但
+非徒
+否则
+嘎
+嘎登
+该
+赶
+个
+各
+各个
+各位
+各种
+各自
+给
+根据
+跟
+故
+故此
+固然
+关于
+管
+归
+果然
+果真
+过
+哈
+哈哈
+呵
+和
+何
+何处
+何况
+何时
+嘿
+哼
+哼唷
+呼哧
+乎
+哗
+还是
+还有
+换句话说
+换言之
+或
+或是
+或者
+极了
+及
+及其
+及至
+即
+即便
+即或
+即令
+即若
+即使
+几
+几时
+己
+既
+既然
+既是
+继而
+加之
+假如
+假若
+假使
+鉴于
+将
+较
+较之
+叫
+接着
+结果
+借
+紧接着
+进而
+尽
+尽管
+经
+经过
+就
+就是
+就是说
+据
+具体地说
+具体说来
+开始
+开外
+靠
+咳
+可
+可见
+可是
+可以
+况且
+啦
+来
+来着
+离
+例如
+哩
+连
+连同
+两者
+了
+临
+另
+另外
+另一方面
+论
+嘛
+吗
+慢说
+漫说
+冒
+么
+每
+每当
+们
+莫若
+某
+某个
+某些
+拿
+哪
+哪边
+哪儿
+哪个
+哪里
+哪年
+哪怕
+哪天
+哪些
+哪样
+那
+那边
+那儿
+那个
+那会儿
+那里
+那么
+那么些
+那么样
+那时
+那些
+那样
+乃
+乃至
+呢
+能
+你
+你们
+您
+宁
+宁可
+宁肯
+宁愿
+哦
+呕
+啪达
+旁人
+呸
+凭
+凭借
+其
+其次
+其二
+其他
+其它
+其一
+其余
+其中
+起
+起见
+岂但
+恰恰相反
+前后
+前者
+且
+然而
+然后
+然则
+让
+人家
+任
+任何
+任凭
+如
+如此
+如果
+如何
+如其
+如若
+如上所述
+若
+若非
+若是
+啥
+上下
+尚且
+设若
+设使
+甚而
+甚么
+甚至
+省得
+时候
+什么
+什么样
+使得
+是
+是的
+首先
+谁
+谁知
+顺
+顺着
+似的
+虽
+虽然
+虽说
+虽则
+随
+随着
+所
+所以
+他
+他们
+他人
+它
+它们
+她
+她们
+倘
+倘或
+倘然
+倘若
+倘使
+腾
+替
+通过
+同
+同时
+哇
+万一
+往
+望
+为
+为何
+为了
+为什么
+为着
+喂
+嗡嗡
+我
+我们
+呜
+呜呼
+乌乎
+无论
+无宁
+毋宁
+嘻
+吓
+相对而言
+像
+向
+向着
+嘘
+呀
+焉
+沿
+沿着
+要
+要不
+要不然
+要不是
+要么
+要是
+也
+也罢
+也好
+一
+一般
+一旦
+一方面
+一来
+一切
+一样
+一则
+依
+依照
+矣
+以
+以便
+以及
+以免
+以至
+以至于
+以致
+抑或
+因
+因此
+因而
+因为
+哟
+用
+由
+由此可见
+由于
+有
+有的
+有关
+有些
+又
+于
+于是
+于是乎
+与
+与此同时
+与否
+与其
+越是
+云云
+哉
+再说
+再者
+在
+在下
+咱
+咱们
+则
+怎
+怎么
+怎么办
+怎么样
+怎样
+咋
+照
+照着
+者
+这
+这边
+这儿
+这个
+这会儿
+这就是说
+这里
+这么
+这么点儿
+这么些
+这么样
+这时
+这些
+这样
+正如
+吱
+之
+之类
+之所以
+之一
+只是
+只限
+只要
+只有
+至
+至于
+诸位
+着
+着呢
+自
+自从
+自个儿
+自各儿
+自己
+自家
+自身
+综上所述
+总的来看
+总的来说
+总的说来
+总而言之
+总之
+纵
+纵令
+纵然
+纵使
+遵照
+作为
+兮
+呃
+呗
+咚
+咦
+喏
+啐
+喔唷
+嗬
+嗯
+嗳
+啊哈
+啊呀
+啊哟
+挨次
+挨个
+挨家挨户
+挨门挨户
+挨门逐户
+挨着
+按理
+按期
+按时
+按说
+暗地里
+暗中
+暗自
+昂然
+八成
+白白
+半
+梆
+保管
+保险
+饱
+背地里
+背靠背
+倍感
+倍加
+本人
+本身
+甭
+比起
+比如说
+比照
+毕竟
+必
+必定
+必将
+必须
+便
+别人
+并非
+并肩
+并没
+并没有
+并排
+并无
+勃然
+不
+不必
+不常
+不大
+不得
+不得不
+不得了
+不得已
+不迭
+不定
+不对
+不妨
+不管怎样
+不会
+不仅仅
+不仅仅是
+不经意
+不可开交
+不可抗拒
+不力
+不了
+不料
+不满
+不免
+不能不
+不起
+不巧
+不然的话
+不日
+不少
+不胜
+不时
+不是
+不同
+不能
+不要
+不外
+不外乎
+不下
+不限
+不消
+不已
+不亦乐乎
+不由得
+不再
+不择手段
+不怎么
+不曾
+不知不觉
+不止
+不止一次
+不至于
+才
+才能
+策略地
+差不多
+差一点
+常
+常常
+常言道
+常言说
+常言说得好
+长此下去
+长话短说
+长期以来
+长线
+敞开儿
+彻夜
+陈年
+趁便
+趁机
+趁热
+趁势
+趁早
+成年
+成年累月
+成心
+乘机
+乘胜
+乘势
+乘隙
+乘虚
+诚然
+迟早
+充分
+充其极
+充其量
+抽冷子
+臭
+初
+出
+出来
+出去
+除此
+除此而外
+除此以外
+除开
+除去
+除却
+除外
+处处
+川流不息
+传
+传说
+传闻
+串行
+纯
+纯粹
+此后
+此中
+次第
+匆匆
+从不
+从此
+从此以后
+从古到今
+从古至今
+从今以后
+从宽
+从来
+从轻
+从速
+从头
+从未
+从无到有
+从小
+从新
+从严
+从优
+从早到晚
+从中
+从重
+凑巧
+粗
+存心
+达旦
+打从
+打开天窗说亮话
+大
+大不了
+大大
+大抵
+大都
+大多
+大凡
+大概
+大家
+大举
+大略
+大面儿上
+大事
+大体
+大体上
+大约
+大张旗鼓
+大致
+呆呆地
+带
+殆
+待到
+单
+单纯
+单单
+但愿
+弹指之间
+当场
+当儿
+当即
+当口儿
+当然
+当庭
+当头
+当下
+当真
+当中
+倒不如
+倒不如说
+倒是
+到处
+到底
+到了儿
+到目前为止
+到头
+到头来
+得起
+得天独厚
+的确
+等到
+叮当
+顶多
+定
+动不动
+动辄
+陡然
+都
+独
+独自
+断然
+顿时
+多次
+多多
+多多少少
+多多益善
+多亏
+多年来
+多年前
+而后
+而论
+而又
+尔等
+二话不说
+二话没说
+反倒
+反倒是
+反而
+反手
+反之亦然
+反之则
+方
+方才
+方能
+放量
+非常
+非得
+分期
+分期分批
+分头
+奋勇
+愤然
+风雨无阻
+逢
+弗
+甫
+嘎嘎
+该当
+概
+赶快
+赶早不赶晚
+敢
+敢情
+敢于
+刚
+刚才
+刚好
+刚巧
+高低
+格外
+隔日
+隔夜
+个人
+各式
+更
+更加
+更进一步
+更为
+公然
+共
+共总
+够瞧的
+姑且
+古来
+故而
+故意
+固
+怪
+怪不得
+惯常
+光
+光是
+归根到底
+归根结底
+过于
+毫不
+毫无
+毫无保留地
+毫无例外
+好在
+何必
+何尝
+何妨
+何苦
+何乐而不为
+何须
+何止
+很
+很多
+很少
+轰然
+后来
+呼啦
+忽地
+忽然
+互
+互相
+哗啦
+话说
+还
+恍然
+会
+豁然
+活
+伙同
+或多或少
+或许
+基本
+基本上
+基于
+极
+极大
+极度
+极端
+极力
+极其
+极为
+急匆匆
+即将
+即刻
+即是说
+几度
+几番
+几乎
+几经
+既…又
+继之
+加上
+加以
+间或
+简而言之
+简言之
+简直
+见
+将才
+将近
+将要
+交口
+较比
+较为
+接连不断
+接下来
+皆可
+截然
+截至
+藉以
+借此
+借以
+届时
+仅
+仅仅
+谨
+进来
+进去
+近
+近几年来
+近来
+近年来
+尽管如此
+尽可能
+尽快
+尽量
+尽然
+尽如人意
+尽心竭力
+尽心尽力
+尽早
+精光
+经常
+竟
+竟然
+究竟
+就此
+就地
+就算
+居然
+局外
+举凡
+据称
+据此
+据实
+据说
+据我所知
+据悉
+具体来说
+决不
+决非
+绝
+绝不
+绝顶
+绝对
+绝非
+均
+喀
+看
+看来
+看起来
+看上去
+看样子
+可好
+可能
+恐怕
+快
+快要
+来不及
+来得及
+来讲
+来看
+拦腰
+牢牢
+老
+老大
+老老实实
+老是
+累次
+累年
+理当
+理该
+理应
+历
+立
+立地
+立刻
+立马
+立时
+联袂
+连连
+连日
+连日来
+连声
+连袂
+临到
+另方面
+另行
+另一个
+路经
+屡
+屡次
+屡次三番
+屡屡
+缕缕
+率尔
+率然
+略
+略加
+略微
+略为
+论说
+马上
+蛮
+满
+没
+没有
+每逢
+每每
+每时每刻
+猛然
+猛然间
+莫
+莫不
+莫非
+莫如
+默默地
+默然
+呐
+那末
+奈
+难道
+难得
+难怪
+难说
+内
+年复一年
+凝神
+偶而
+偶尔
+怕
+砰
+碰巧
+譬如
+偏偏
+乒
+平素
+颇
+迫于
+扑通
+其后
+其实
+奇
+齐
+起初
+起来
+起首
+起头
+起先
+岂
+岂非
+岂止
+迄
+恰逢
+恰好
+恰恰
+恰巧
+恰如
+恰似
+千
+万
+千万
+千万千万
+切
+切不可
+切莫
+切切
+切勿
+窃
+亲口
+亲身
+亲手
+亲眼
+亲自
+顷
+顷刻
+顷刻间
+顷刻之间
+请勿
+穷年累月
+取道
+去
+权时
+全都
+全力
+全年
+全然
+全身心
+然
+人人
+仍
+仍旧
+仍然
+日复一日
+日见
+日渐
+日益
+日臻
+如常
+如此等等
+如次
+如今
+如期
+如前所述
+如上
+如下
+汝
+三番两次
+三番五次
+三天两头
+瑟瑟
+沙沙
+上
+上来
+上去
+一.
+一一
+一下
+一个
+一些
+一何
+一则通过
+一天
+一定
+一时
+一次
+一片
+一番
+一直
+一致
+一起
+一转眼
+一边
+一面
+上升
+上述
+上面
+下
+下列
+下去
+下来
+下面
+不一
+不久
+不变
+不可
+不够
+不尽
+不尽然
+不敢
+不断
+不若
+不足
+与其说
+专门
+且不说
+且说
+严格
+严重
+个别
+中小
+中间
+丰富
+为主
+为什麽
+为止
+为此
+主张
+主要
+举行
+乃至于
+之前
+之后
+之後
+也就是说
+也是
+了解
+争取
+二来
+云尔
+些
+亦
+产生
+人
+人们
+什麽
+今
+今后
+今天
+今年
+今後
+介于
+从事
+他是
+他的
+代替
+以上
+以下
+以为
+以前
+以后
+以外
+以後
+以故
+以期
+以来
+任务
+企图
+伟大
+似乎
+但凡
+何以
+余外
+你是
+你的
+使
+使用
+依据
+依靠
+便于
+促进
+保持
+做到
+傥然
+儿
+允许
+元/吨
+先不先
+先后
+先後
+先生
+全体
+全部
+全面
+共同
+具体
+具有
+兼之
+再
+再其次
+再则
+再有
+再次
+再者说
+决定
+准备
+凡
+凡是
+出于
+出现
+分别
+则甚
+别处
+别是
+别管
+前此
+前进
+前面
+加入
+加强
+十分
+即如
+却
+却不
+原来
+又及
+及时
+双方
+反应
+反映
+取得
+受到
+变成
+另悉
+只
+只当
+只怕
+只消
+叫做
+召开
+各人
+各地
+各级
+合理
+同一
+同样
+后
+后者
+后面
+向使
+周围
+呵呵
+咧
+唯有
+啷当
+喽
+嗡
+嘿嘿
+因了
+因着
+在于
+坚决
+坚持
+处在
+处理
+复杂
+多么
+多数
+大力
+大多数
+大批
+大量
+失去
+她是
+她的
+好
+好的
+好象
+如同
+如是
+始而
+存在
+孰料
+孰知
+它们的
+它是
+它的
+安全
+完全
+完成
+实现
+实际
+宣布
+容易
+密切
+对应
+对待
+对方
+对比
+小
+少数
+尔
+尔尔
+尤其
+就是了
+就要
+属于
+左右
+巨大
+巩固
+已
+已矣
+已经
+巴
+巴巴
+帮助
+并不
+并不是
+广大
+广泛
+应当
+应用
+应该
+庶乎
+庶几
+开展
+引起
+强烈
+强调
+归齐
+当前
+当地
+当时
+形成
+彻底
+彼时
+往往
+後来
+後面
+得了
+得出
+得到
+心里
+必然
+必要
+怎奈
+怎麽
+总是
+总结
+您们
+您是
+惟其
+意思
+愿意
+成为
+我是
+我的
+或则
+或曰
+战斗
+所在
+所幸
+所有
+所谓
+扩大
+掌握
+接著
+数/
+整个
+方便
+方面
+无
+无法
+既往
+明显
+明确
+是不是
+是以
+是否
+显然
+显著
+普通
+普遍
+曾
+曾经
+替代
+最
+最后
+最大
+最好
+最後
+最近
+最高
+有利
+有力
+有及
+有所
+有效
+有时
+有点
+有的是
+有着
+有著
+末##末
+本地
+来自
+来说
+构成
+某某
+根本
+欢迎
+欤
+正值
+正在
+正巧
+正常
+正是
+此地
+此处
+此时
+此次
+每个
+每天
+每年
+比及
+比较
+没奈何
+注意
+深入
+清楚
+满足
+然後
+特别是
+特殊
+特点
+犹且
+犹自
+现代
+现在
+甚且
+甚或
+甚至于
+用来
+由是
+由此
+目前
+直到
+直接
+相似
+相信
+相反
+相同
+相对
+相应
+相当
+相等
+看出
+看到
+看看
+看见
+真是
+真正
+眨眼
+矣乎
+矣哉
+知道
+确定
+种
+积极
+移动
+突出
+突然
+立即
+竟而
+第二
+类如
+练习
+组成
+结合
+继后
+继续
+维持
+考虑
+联系
+能否
+能够
+自后
+自打
+至今
+至若
+致
+般的
+良好
+若夫
+若果
+范围
+莫不然
+获得
+行为
+行动
+表明
+表示
+要求
+规定
+觉得
+譬喻
+认为
+认真
+认识
+许多
+设或
+诚如
+说明
+说来
+说说
+诸
+诸如
+谁人
+谁料
+贼死
+赖以
+距
+转动
+转变
+转贴
+达到
+迅速
+过去
+过来
+运用
+还要
+这一来
+这次
+这点
+这种
+这般
+这麽
+进入
+进步
+进行
+适应
+适当
+适用
+逐步
+逐渐
+通常
+造成
+遇到
+遭到
+遵循
+避免
+那般
+那麽
+部分
+采取
+里面
+重大
+重新
+重要
+针对
+问题
+防止
+附近
+限制
+随后
+随时
+随著
+难道说
+集中
+需要
+非特
+非独
+高兴
+若果
+为止
+纵然
+all
+例如
+[④e]
+when
+亦
+来讲
+谁料
+届时
+或多或少
+不外
+即使
+独自
+啐
+反倒
+=☆
+you'll
++ξ
+哎呀
+yet
+从轻
+切不可
+举行
+specified
+进而
+]
+[②g]
+hello
+嗡
+绝
+传说
+despite
+吧哒
+临到
+川流不息
+心里
+they're
+过去
+不迭
+坚决
+管
+亲手
+竟而
+some
+理当
+最
+断然
+好象
+此间
+不下
+serious
+their
+本地
+而已
+和
+≈
+following
+不可开交
+[②c] 
+—
+乘隙
+咚
+however
+屡次三番
+almost
+不时
+半
+依照
+多多少少
+--
+当头
+距
+刚巧
+喽
+上去
+假如
+后
+changes
+任
+叮咚
+独
+came
+如此等等
+切切
+也是
+对比
+)、
+注意
+⑨
+taken
+以后
+能
+[③c]
+wherever
+thence
+两者
+顺着
+gone
+宣布
+5:0  
+伟大
+互相
+尽管
+恰巧
+几度
+嗬
+what
+刚才
+总结
+故此
+≈ 
+使得
+顷刻间
+[①⑤]
+got
+相等
+适应
+屡
+怪不得
+不免
+也罢
+⑩
+these
+这样
+ignored
+you're
+够瞧的
+[③g]
+ok
+来自
+the
+存心
+fifth
+they've
+2
+略加
+立地
+我的
+of
+behind
+不胜
+many
+假若
+打
+~~~~
+白白
+specifying
+就要
+拿
+率尔
+表示
+多么
+2
+below
+weren't
+③]
+反手
+极为
+如上
+[②⑦]
+theirs
+一
+本
+复杂
+^
+长线
+there
+凡
+毫无保留地
+<φ
+更进一步
+让
+分期
+*
+不可抗拒
+尔尔
+除此以外
+㈧ 
+近年来
+于
+就算
+理应
+furthermore
+不要
+因为
+doesn't
+不若
+人人
+’
+大多数
+不单
+[②②]
+砰
+它是
+[②⑤]
+~+
+且不说
+前此
+=(
+}
+namely
+amongst
+矣乎
+<λ
+今年
+anyone
+除了
+具体地说
+尽早
+尽量
+诸如
+containing
+今後
+旁人
+其
+do
+self
+our
+依
+蛮
+鄙人
+indicated
+[②B] 
+whereby
+倒不如
+以来
+次第
+达旦
+less
+是不是
+yourselves
+shall
+应用
+A
+~
+〈
+明显
+allow
+那边
+sorry
+7
+难得
+尽心尽力
+&
+ours
+您们
+too
+强调
+一何
+齐
+from
+[⑨]
+a]
+就是了
+规定
+也就是说
+[⑤e]
+my
+为了
+彻夜
+出
+来
+eg
+日臻
+不满
+如下
+仍旧
+满足
+各个
+如若
+moreover
+主张
+mostly
+anywhere
+为什麽
+认为
+从未
+极
+方
+地
+今后
+同时
+们
+say
+上来
+决非
+通过
+hence
+一次
+其它
+::
+严重
+tried
+左右
+much
+因此
+千万
+伙同
+快
+近几年来
+如次
+不论
+`
+third
+formerly
+但
+嘻
+now
+还有
+by
+绝顶
+嘘
+[②b]
+exp
+巴
+难道说
+其一
+here
+人
+周围
+(
+始而
+in
+三
+个别
+恰恰相反
+哪怕
+=-
+按期
+扩大
+千万千万
+策略地
+不对
+每年
+nothing
+’‘ 
+起
+话说
+upon
+猛然间
+=
+别
+打开天窗说亮话
+instead
+边
+不已
+什么
+乘虚
+want
+|
+则
+替
+局外
+knows
+抽冷子
+的话
+立马
+若是
+表明
+认识
+多亏
+定
+[②a]
+上
+where's
+当下
+何必
+乃至
+不止一次
+从来
+倍感
+呜
+tends
+right
+是
+当时
+非常
+哈哈
+趁热
+人民
+没有
+切
+获得
+这些
+有力
+除却
+off
+goes
+whoever
+known
+概
+may
+asking
+避免
+暗中
+[①①]
+“
+'
+everything
++
+二话没说
+从此以后
+莫不
+②
+哎哟
+brief
+just
+吧
+不得
+▲
+本人
+nine
+不怎么
+何苦
+? 
+consequently
+clearly
+th
+whereas
+一致
+否则
+尽
+这么样
+这种
+went
+一方面
+,
+able
+屡次
+我们
+日复一日
+near
+运用
+另行
+$
+较
+即刻
+regardless
+they'd
+4
+there's
+论
+今天
+useful
+[①o]
+弗
+曾
+sometimes
+有利
+is
+又及
+这儿
+通常
+am
+成心
+--
+least
+将近
+强烈
+据实
+准备
+俺
+显然
+already
+失去
+犹且
+当地
+最後
+随着
+thru
+unlikely
+借此
+了
+何须
+吓
+不但
+随
+won't
+anyway
+currently
+藉以
+×××
+more
+乘机
+不妨
+甚么
+倘若
+公然
+不惟
+甚或
+你是
+有的是
+更加
+一些
+由此
+R.L.
+大批
+-- 
+后来
+首先
+a's
+此外
+0:2
+呸
+总之
+[②⑧]
+.
+的
+to
+might
+一直
+宁可
+thoroughly
+不力
+上面
+范围
+当场
+et
+何尝
+八成
+per
+saying
+/
+once
+-β
+呢
+之
+among
+un
+从小
+忽然
+矣哉
+everywhere
+挨门逐户
+权时
+indicate
+进行
+其次
+得起
+怕
+[③d]
+唯有
+不同
+大家
+take
+seem
+她的
+appreciate
+contains
+二话不说
+此次
+let
+反映
+如同
+/
+①
+似的
+相当
+大约
+awfully
+herself
+[②c]
+哦
+请勿
+12%
+里面
+ng昉
+望
+either
+背地里
+转动
+挨次
+慢说
+0:2 
+zt
+both
+does
+→
+causes
+has
+好
+hardly
+莫如
+按照
+哗
+used
+大举
+哎
+连
+更为
+whither
+looking
+与此同时
+啪达
+必定
+一则
+啷当
+恰如
+起先
+或是
+毫不
+换言之
+大张旗鼓
+以及
+从中
+某些
+={
+上下
+既是
+赶
+敢
+be
+勃然
+thank
+whether
+please
+每个
+[①c]
+从无到有
+四
+重要
+<±
+防止
+———
+之所以
+极端
+0
+将
+自后
+yourself
+怎么
+不比
+基于
+结果
+9
+当
+这般
+i'm
+凭
+连日
+[
+那么样
+简而言之
+乃
+于是
+甭
+该
+seeming
+them
+it
+成为
+从优
+何以
+不能不
+单纯
+大多
+赖以
+逐渐
+here's
+一片
+碰巧
+汝
+ex
+加上
+诸
+隔日
+placed
+穷年累月
+$
+had
+下面
+之一
+加强
+换句话说
+直到
+我是
+hither
+through
+召开
+竟然
+嗳
+若果 
+反之则
+绝对
+一旦
+!
+#
+方面
+而况
+其余
+大不了
+haven't
+广大
+比起
+若
+从不
+何妨
+诚如
+后面
+矣
+难道
+~
+充其极
+古来
+nearly
+不可
+wasn't
+间或
+个
+却
+以为
+单
+consider
+坚持
+see
+别处
+downwards
+become
+[①A]
+啊
+反而
+那么些
+we've
+乌乎
+先不先
+——
+greetings
+every
+!
+迫于
+,也
+last
+允许
+率然
+would
+特点
+』
+下列
+尽快
+之后
+several
+甚而
+”
+|
+*
+即将
+哪
+hadn't
+非独
+人家
+毕竟
+相对而言
+截至
+咋
+zero
+wouldn't
+很少
+necessary
+corresponding
+particular
+next
+限制
+全力
+当庭
+而且
+咦
+specify
+whom
+somewhere
+看来
+有著
+历
+her
+敢于
+ZT
+哗啦
+从
+多次
+无
+末##末
+非但
+些
+」
+不少
+unfortunately
+设或
+不料
+按
+出于
+out
+这一来
+应当
+密切
+appropriate
+unless
+行动
+…………………………………………………③
+仅
+只消
+why
+何处
+却不
+不变
+]∧′=[
+hereupon
+保管
+常常
+[①③]
+〕〔
+紧接着
+someone
+最好
+先後
+可见
+except
+wherein
+also
+引起
+并
+俺们
+别管
+can
+whenever
+it'll
+另一方面
+交口
+保持
+[②③]
+tries
+决定
+必要
+[①⑥]
+保险
+everybody
+going
+嘿嘿
+反应
+nowhere
+关于
+牢牢
+根本
+。
+为主
+不足
+深入
+看见
+路经
+whereafter
+用来
+是的
+过来
+单单
+[②
+着
+初
+皆可
+something
+you'd
+有些
+somewhat
+较比
+[⑩]
+somehow
+谁
+针对
+要求
+its
+不敢
+indicates
+later
+together
+whereupon
+莫若
+其他
+某个
+尽如人意
+contain
+连日来
+仍然
+不巧
+merely
+正在
+从早到晚
+且说
+巨大
+假使
+,也 
+别人
+somebody
+怎
+[③①]
+严格
+ 
+果真
+由于
+纵令
+据我所知
+于是乎
+社会主义
+切莫
+如果
+何
+这麽
+cant
+相应
+与其说
+串行
+#
+安全
+便
+这会儿
+who
+who's
+不怕
+极了
+附近
+反过来
+争取
+with
+到头
+遵照
+++
+不够
+莫非
+除开
+不亦乐乎
+即便
+倘
+being
+[②j]
+自
+[⑤]]
+被
+多多益善
+come
+好的
+转变
+certain
+non
+近来
+不成
+几
+或许
+whatever
+哉
+零
+nevertheless
+//
+particularly
+常言说得好
+⑧
+均
+类如
+岂但
+along
+是否
+并没
+而
+cannot
+.
+as
+比
+2.3%
+看上去
+五
+它
+接著
+不外乎
+并无
+离
+个人
+对方
+除外
+another
+[②①]
+[④a]
+缕缕
+selves
+=[
+凑巧
+再者说
+novel
+怎么办
+哇
+哼
+真正
+莫不然
+_
+有的
+您
+obviously
+如此
+略
+respectively
+并没有
+宁
+挨家挨户
+不大
+拦腰
+就
+岂止
+当中
+us
+1. 
+;
+不得已
+分头
+默然
+故
+concerning
+不择手段
+不知不觉
+一定
+倘或
+贼死
+她
+and
+而外
+reasonably
+彼时
+re
+遇到
+normally
+look
+尽然
+焉
+[⑦]
+can't
+?
+⑤
+要不是
+练习
+数/
+奋勇
+becoming
+非徒
+就是说
+以免
+few
+各地
+一一
+believe
+明确
+一天
+以致
+多数
+普遍
+因了
+另悉
+嗯
+而又
+尚且
+虽说
+既
+加入
+well
+顿时
+[⑤f]
+sup
+[⑤]
+certainly
+巴巴
+行为
+来得及
+yours
+indeed
+nor
+乃至于
+则甚
+三番五次
+不特
+只是
+临
+neither
+并肩
+哩
+could
+多年前
+前后
+当真
+呗
+具体
+较为
+各自
+then
+陡然
+以
+tell
+成年
+已矣
+不
+trying
+…
+相同
+不但...而且
+云云
+积极
+全都
+後面
+瑟瑟
+那样
+各级
+ought
+必须
+viz
+只怕
+正巧
+起头
+toward
++
+倘然
+如期
+so
+千
+方能
+如常
+随著
+怪
+〕
+no
+:
+不独
+惯常
+日见
+happens
+几经
+对应
+少数
+let's
+me
+because
+敞开儿
+只
+having
+第二
+诚然
+beside
+get
+先后
+简直
+[①]
+mainly
+当着
+一下
+特殊
+甫
+有关
+down
+<<
+i'd
+立时
+不拘
+然而
+[④c]
+其二
+3
+因而
+每每
+[④b]
+via
+如何
+目前
+便于
+曾经
+此处
+9
+各式
+作为
+hers
+再次
+从此
+得到
+[*]
+we're
+1.
+.日
+这里
+高低
+mean
+比照
+他们
+故意
+开始
+啥
+趁
+会
+而后
+继而
+存在
+理该
+outside
+所有
+沿着
+联袂
+猛然
+并不
+没奈何
+an
+朝着
+而言
+him
+逢
+0
+亲身
+lest
+former
+℃ 
+>>
+合理
+论说
+专门
+[②⑩]
+[③b]
+上升
+得出
+如前所述
+那般
+腾
+自各儿
+不起
+马上
+一边
+当口儿
+意思
+似乎
+就是
+相对
+随后
+不止
+don't
+only
+provides
+别说
+这点
+使
+高兴
+由是
+什麽
+同一
+此时
+以下
+...................
+较之
+要不然
+′|
+前面
+及
+归根结底
+叫做
+很多
+您是
+扑通
+叫
+前进
+不管
+每时每刻
+appear
+whence
+大都
+everyone
+如
+一起
+但愿
+豁然
+better
+最大
+大抵
+之前
+除
+达到
+6
+总而言之
+以外
+几番
+rather
+有及
+即令
+『
+besides
+已经
+起初
+越是
+[⑤b]
+[⑥]
+have
+弹指之间
+常
+uses
+presumably
+它的
+因着
+万一
+其实
+集中
+seemed
+这时
+keeps
+代替
+5
+b]
+↑
+挨门挨户
+要不
+但是
+之类
+以至
+简言之
+的确
+onto
+name
+[①g]
+所以
+exp 
+allows
+each
+did
+喂
+they'll
+within
+大体
+那麽
+wish
+welcome
+下
+属于
+开展
+连同
+起首
+(
+挨着
+时候
+往往
+为此
+不久
+继之
+固
+除此
+清楚
+thanks
+.日 
+从今以后
+这么点儿
+必将
+according
+完全
+-[*]-
+大致
+不然的话
+eight
+归根到底
+不问
+奈
+available
+you've
+从事
+略微
+other
+此后
+lately
+others
+切勿
+分别
+多少
+one
+five
+动不动
+有时
+Ⅲ
+plus
+怎么样
+think
+知道
+℃
+f]
+不由得
+起来
+ZZ
+A
+][
+随时
+regarding
+乘
+同
+以期
+though
+哪年
+一来
+并排
+出去
+可
+说明
+[①⑦]
+再
+岂
+likely
+secondly
+总的来看
+趁着
+相似
+重大
+always
+best
+[①f]
+none
+possible
+while
+臭
+非得
+极度
+5
+whole
+看出
+ones
+纯
+thanx
+已
+战斗
+./
+既...又
+beyond
+然
+beforehand
+that's
+哼唷
+[①d]
+看起来
+associated
+above
+Lex
+得
+given
+反之
+造成
+接连不断
+不是
+[①h]
+还是
+中小
+最后
+在于
+看
+甚至于
+从新
+我
+略为
+虽则
+竟
+不管怎样
+直接
+按说
+每天
+现代
+anybody
+恰似
+常言说
+顶多
+seeing
+otherwise
+再有
+据称
+}>
+种
+陈年
+new
+3
+绝非
+said
+)÷(1-
+凡是
+移动
+说说
+are
+并且
+谁人
+became
+介于
+广泛
+although
+再则
+该当
+不必
+不能
+儿
+不了
+for
+it's
+saw
+平素
+尽可能
+go
+何止
+另
+described
+一切
+三番两次
+谨
+away
+容易
+取得
+he's
+ie
+③
+老
+这么
+才
+second
+hereafter
+还
+《
+不仅...而且
+归齐
+way
+得天独厚
+总是
+轰然
+都
+她们
+岂非
+ 
+took
+old
+当儿
+怎样
+活
+巩固
+-- 
+喔唷
+甚且
+反之亦然
+显著
+或曰
+without
+无论
+全身心
+喏
+迄
+ask
+therefore
+across
+只要
+按时
+∈[ 
+didn't
+除非
+产生
+毋宁
+累年
+过
+themselves
+照
+喀
+除去
+4
+ain't
+倒不如说
+you
+far
+<Δ
+we
+有
+%
+不定
+使用
+■
+长此下去
+{-
+问题
+此
+背靠背
+thereafter
+乘势
+else
+》),
+乎
+从重
+形成
+inward
+noone
+alone
+aside
+尔等
+}
+将要
+regards
+挨个
+遭到
+he
+那儿
+抑或
+on
+冒
+呆呆地
+实际
+[②h]
+全体
+进来
+sensible
+为什么
+别的
+多多
+累次
+而论
+不会
+连连
+啊哈
+奇
+由
+见
+entirely
+吱
+comes
+又
+况且
+@
+朝
+欢迎
+gotten
+isn't
+under
+因
+省得
+okay
+急匆匆
+followed
+howbeit
+能否
+enough
+差不多
+丰富
+他
+确定
+顺
+;
+及其
+据说
+及至
+亲口
+即是说
+下来
+谁知
+部分
+从古至今
+your
+每逢
+不限
+seems
+可以
+譬如
+结合
+遵循
+比方
+精光
+during
+到
+doing
+〉
+待到
+从古到今
+anything
+至若
+难怪
+herein
+[①⑧]
+以至于
+它们
+赶快
+依靠
+but
+吗
+keep
+光
+连声
+要是
+needs
+据
+thereby
+归
+日渐
+起见
+>
+给
+]
+孰知
+[②G]
+大事
+use
+forth
+并不是
+多年来
+thereupon
+⑥
+elsewhere
+couldn't
+呼哧
+LI
+到目前为止
+unto
+待
+元/吨
+纵使
+为
+[②④
+充分
+since
+且
+theres
+觉得
+只当
+[②e]
+[⑧]
+一般
+大量
+那些
+彼
+will
+而是
+any
+over
+是以
+看到
+probably
+设使
+或则
+放量
+really
+虽
+仅仅
+himself
+实现
+itself
+彼此
+总的来说
+正如
+自个儿
+or
+兮
+到头来
+二来
+》
+原来
+己
+不光
+各
+借
+每
+那
+thorough
+至今
+ever
+促进
+白
+屡屡
+满
+赶早不赶晚
+倒是
+were
+开外
+迅速
+处理
+靠
+正值
+经常
+哪些
+良好
+尔后
+=
+用
+差一点
+try
+kept
+要
+ZXFITL
+以便
+惟其
+然后
+edu
+极其
+只有
+反倒是
+……
+做到
+wants
+sub
+进入
+多
+真是
+为着
+φ.
+饱
+que
+某某
+truly
+凭借
+并非
+three
+但凡
+呕
+固然
+especially
+各人
+虽然
+apart
+不过
+_
+殆
+嘿
+啊哟
+叮当
+哈
+可是
+基本上
+具体来说
+趁机
+为何
+适当
+以故
+cause
+以後
+适用
+与
+一.
+前者
+gets
+different
+凝神
+不日
+各位
+尽心竭力
+变成
+latter
+t's
+互
+如今
+>
+倘使
+本身
+>λ
+ourselves
+昂然
+进步
+between
+six
+接下来
+无宁
+既然
+&
+日益
+果然
+顷
+before
+sometime
+亲眼
+own
+兼之
+任凭
+其后
+无法
+[②d]
+哪里
+趁势
+更
+加之
+definitely
+further
+恐怕
+such
+[②⑥]
+方便
+一转眼
+毫无
+不仅
+本着
+[③e]
+ltd
+从严
+不断
+嘎登
+一番
+.一
+不至于
+呀
+对于
+般的
+seriously
+不一
+很
+[④d]
+【
+九
+阿
+~±
+exactly
+将才
+若夫
+we'd
+反过来说
+老大
+最高
+呵呵
+[①C]
+所
+④
+中间
+说来
+two
+许多
+有所
+姑且
+突出
+哪边
+哪样
+∪φ∈
+某
+罢了
+然後
+perhaps
+[⑤a]
+暗自
+等等
+不如
+=″
+匆匆
+、
+孰料
+何乐而不为
+c]
+{
+据此
+不得不
+four
+aren't
+meanwhile
+仍
+<
+从而
+同样
+常言道
+内
+维持
+或者
+偏偏
+隔夜
+重新
+immediate
+继续
+大面儿上
+傥然
+能够
+that
+这次
+尤其
+它们的
+自身
+共同
+任何
+first
+”,
+後来
+趁早
+quite
+第
+it'd
+liked
+考虑
+致
+正常
+against
+@
+去
+敢情
+那会儿
+等到
+自家
+进去
+this
+恍然
+举凡
+‘
+[③]
+towards
+把
+co
+二
+光是
+再说
+[①i]
+刚好
+唉
+即或
+follows
+inasmuch
+c's
+再其次
+Lex 
+until
+成年累月
+’‘
+出来
+thus
+e]
+来着
+沿
+啦
+]∧′=[ 
+这个
+那么
+具体说来
+得了
+了解
+好在
+经过
+沙沙
+极大
+今
+犹自
+纵
+企图
+[①E]
+[②B]
+,
+大概
+at
+应该
+当然
+hereby
+oh
+never
+只限
+那个
+咳
+i've
+example
+actually
+[⑨] 
+嗡嗡
+传闻
+对待
+向使
+跟
+overall
+不然
+默默地
+c'mon
+his
+. 
+help
+哪儿
+除此而外
+既往
+刚
+愤然
+[②f]
+\
+以前
+been
+com
+来说
+老老实实
+乘胜
+about
+)
+哪个
+......
+相反
+latterly
+从宽
+呼啦
+怎麽
+if
+取道
+冲
+most
+must
+漫说
+[①②]
+6
+过于
+至于
+忽地
+若非
+逐步
+大力
+如是
+[
+非特
+另外
+大
+看看
+...
+就地
+加以
+)
+yes
+咱们
+比及
+充其量
+after
+little
+哟
+必
+主要
+顷刻
+?
+老是
+──
+此中
+一面
+另一个
+暗地里
+连袂
+1
+嘎
+hopefully
+风雨无阻
+8
+"
+立即
+course
+says
+[①a]
+insofar
+之後
+尔
+在
+getting
+same
+〔
+know
+偶而
+来不及
+人们
+嘛
+seven
+looks
+从头
+他人
+这
+究竟
+若果
+决不
+:
+借以
+恰恰
+5:0
+基本
+considering
+到处
+掌握
+如其
+像
+zz
+不仅仅
+.数
+那时
+qv
+不经意
+动辄
+尽管如此
+than
+1
+毫无例外
+近
+完成
+几时
+极力
+三天两头
+经
+value
+shouldn't
+等
+etc
+怎奈
+宁肯
+[①D]
+任务
+<
+throughout
+where
+小
+各种
+据悉
+-
+格外
+设若
+着呢
+联系
+恰逢
+wonder
+眨眼
+how
+://
+全年
+⑦
+共
+anyhow
+居然
+绝不
+你
+甚至
+根据
+twice
+这边
+gives
+therein
+[]
+becomes
+其中
+才能
+呐
+大凡
+[①⑨]
+迟早
+inc
+[①B]
+..
+不尽
+全然
+这就是说
+纯粹
+粗
+nobody
+从速
+哪天
+正是
+到底
+we'll
+very
+特别是
+看样子
+每当
+不只
+此地
+seen
+whose
+××× 
+全部
+如上所述
+整个
+诸位
+like
+大大
+彻底
+他是
+需要
+[③F]
+偶尔
+一样
+替代
+around
+㈧
+愿意
+大略
+自从
+不得了
+继后
+七
+那里
+可好
+十分
+一个
+受到
+组成
+故而
+[③h]
+[②i]
+'
+你们
+处在
+与否
+接着
+nd
+啊呀
+亲自
+先生
+相信
+up
+上述
+一则通过
+不曾
+除此之外
+自打
+what's
+分期分批
+庶几
+still
+具有
+[-
+not
+她是
+afterwards
+即若
+again
+来看
+anyways
+7
+及时
+帮助
+不再
+或
+现在
+云尔
+立刻
+sent
+何况
+余外
+[③a]
+方才
+倍加
+年复一年
+比如说
+另方面
+嘎嘎
+i'll
+还要
+鉴于
+截然
+往
+they
+带
+[①e]
+出现
+need
+呵
+8
+莫
+向着
+在下
+she
+rd
+六
+using
+由此可见
+向
+照着
+全面
+various
+%
+vs
+∈[
+传
+趁便
+所谓
+accordingly
+对
+按理
+willing
+然则
+梆
+usually
+这么些
+长话短说
+长期以来
+咱
+即
+relatively
+没
+不仅仅是
+所在
+窃
+′∈
+者
+一时
+even
+难说
+should
+可能
+打从
+有着
+hi
+myself
+宁愿
+突然
+[⑤d]
+总的说来
+often
+采取
+以上
+呜呼
+有点
+不尽然
+处处
+[④]
+普通
+[①④]
+后者
+颇
+thats
+认真
+譬喻
+依据
+综上所述
+八
+那末
+inner
+立
+共总
+至
+sure
+hasn't
+-
+不常
+不消
+要么
+[②]
+into
+何时
+即如
+顷刻之间
+再者
+别是
+恰好
+咧
+也好
+庶乎
+those
+么
+与其
+构成
+呃
+was
+双方
+下去
+当即
+自己
+乒
+也
+你的
+比较
+必然
+大体上
+几乎
+︿
+有效
+他的
+到了儿
+②c
+就此
+所幸
+转贴
+】
+[③⑩]
+soon
+比如
+快要
+done
+什么样
+maybe
+which
+欤
+最近
+当前

+ 94 - 0
python/load_data.py

@@ -0,0 +1,94 @@
+
+import os
+import re
+import jieba
+import time
+import numpy as np
+
+# jieba.enable_parallel() # jieba支持多进程 ,但是win不支持
+
+token = "[0-9\s+\.\!\/_,$%^*()?;;:【】+\"\'\[\]\\]+|[+——!,;:。?《》、~@#¥%……&*()“”.=-]+"
+labels_index = {} # 记录分类标签的序号
+stopwords = set(open('dict/stop_words.txt', encoding='utf-8').read().split()) # 停用词
+
+
+# for scikit part
+
+def preprocess(text):
+    text1 = re.sub('&nbsp', ' ', text)
+    str_no_punctuation = re.sub(token, ' ', text1)  # 去掉标点
+    text_list = list(jieba.cut(str_no_punctuation))   # 分词列表
+    text_list = [item for item in text_list if item != ' '] # 去掉空格
+    return ' '.join(text_list)
+
+
+def load_datasets():
+    # should run corpus_split.py first
+
+    base_dir = 'tag/'
+    X_data = {'train':[], 'test':[]}
+    y = {'train':[], 'test':[]}
+    for type_name in ['train', 'test']:
+        corpus_dir = os.path.join(base_dir, type_name)
+        for label in os.listdir(corpus_dir):
+            label_dir = os.path.join(corpus_dir, label)
+            file_list = os.listdir(label_dir)
+            print("label: {}, len: {}".format(label, len(file_list)))
+
+            for fname in file_list:
+                file_path = os.path.join(label_dir, fname)
+                with open(file_path, encoding='UTF-8', errors='ignore') as text_file:
+                    text_content = preprocess(text_file.read())
+                X_data[type_name].append(text_content)
+                y[type_name].append(label)
+
+        print("{} corpus len: {}\n".format(type_name, len(X_data[type_name])))
+    
+    return X_data['train'], y['train'], X_data['test'], y['test']
+
+
+# for keras part
+
+def preprocess_keras(text):
+    text1 = re.sub('&nbsp', ' ', text)
+    str_no_punctuation = re.sub(token, ' ', text1)  # 去掉标点
+    text_list = list(jieba.cut(str_no_punctuation))   # 分词列表
+    text_list = [item for item in text_list if item != ' ' and item not in stopwords] # 去掉空格和停用词
+    return ' '.join(text_list)
+
+
+def load_raw_datasets():    
+    labels = []
+    texts = []
+    base_dir = 'CN_Corpus/SogouC.reduced/Reduced'
+    t1 = time.time()
+    for cate_index, label in enumerate(os.listdir(base_dir)):
+        label_dir = os.path.join(base_dir, label)
+        file_list = os.listdir(label_dir)
+        labels_index[label] = cate_index # 记录分类标签的整数标号
+        print("label: {}, len: {}".format(label, len(file_list)))
+
+        for fname in file_list:
+            f = open(os.path.join(label_dir, fname), encoding='gb2312', errors='ignore')
+            texts.append(preprocess_keras(f.read()))
+            f.close()
+            labels.append(labels_index[label])
+            
+    t2 = time.time()
+    tm_cost = t2-t1
+    print('\nDone. {} total categories, {} total docs. cost {} seconds.'.format(len(os.listdir(base_dir)), len(texts), tm_cost))
+    return texts, labels
+
+def load_pre_trained():
+    # load pre-trained embedding model
+    embeddings_index = {}
+    with open('Embedding/sgns.sogou.word') as f:
+        _, embedding_dim = f.readline().split()    
+        for line in f:
+            values = line.split()
+            word = values[0]
+            coefs = np.asarray(values[1:], dtype='float32')
+            embeddings_index[word] = coefs
+
+    print('Found %s word vectors, dimension %s' % (len(embeddings_index), embedding_dim))
+    return embeddings_index

BIN
python/naiveBayesrClassifier.model


+ 74 - 0
python/web.py

@@ -0,0 +1,74 @@
+import os
+import shutil
+import re
+import json
+
+import numpy as np 
+from wordcloud import WordCloud
+import matplotlib.pyplot as plt
+
+from sklearn.pipeline import Pipeline
+from sklearn.feature_extraction.text import TfidfVectorizer
+from sklearn.naive_bayes import MultinomialNB
+from sklearn.linear_model import LogisticRegression, SGDClassifier
+from sklearn.calibration import CalibratedClassifierCV
+from sklearn.metrics import classification_report, confusion_matrix
+from const import category_labels
+from load_data import preprocess, load_datasets
+from sklearn.externals import joblib
+import heapq
+from flask import Flask,request,jsonify
+
+a = open(r"x_tr_list.json", "r",encoding='UTF-8')
+X_train_data =json.loads(a.read())
+a.close()
+
+b = open(r"y_tr_list.json", "r",encoding='UTF-8')
+y_train =json.loads(b.read())
+b.close()
+
+new_li=[]
+for i in y_train:
+    if i not in new_li:
+        new_li.append(i)
+stopwords = open('dict/stop_words.txt', encoding='utf-8').read().split()
+
+tfidf_vectorizer = TfidfVectorizer(stop_words=stopwords)
+X_train_tfidf = tfidf_vectorizer.fit_transform(X_train_data)
+
+classifier=joblib.load('naiveBayesrClassifier.model')
+text_clf_svm=joblib.load('SvmClassifier.model')
+
+def getKnowledgeIds(req):
+    new_data = preprocess(req['text'])
+    get = tfidf_vectorizer.transform([new_data])[0]
+    predicted = classifier.predict_proba(get)
+    arr_aa = np.array(predicted)[0]
+    arr_aa = arr_aa.tolist()
+    predicted_svm = text_clf_svm.predict([new_data])
+    res=predicted_svm.tolist()
+    re2 = map(arr_aa.index, heapq.nlargest(5, arr_aa)) 
+    l =list(re2)
+    for f in l:
+        if new_li[f]!=res[0]:
+            res.append(new_li[f])
+    return res
+
+news_lastest = ["stem = 在支持多线程的操作系统中,假设进程 P 创建了若干个线程,那么( ) 是不能被这些线程共享的。, options = {A=该进程的代码段, B=该进程中打开的文件, C=该进程的全局变量, D=该进程中某线程的栈指针}, answer = D, analysis = 在同一进程中的各个线程都可以共享该进程所拥有的资源,如访问进程地址空间中的每一个虚地址;访问进程拥有已打开文件、定时器、信号量机构等,但是不能共享进程中某线程的栈指针。",
+                "stem = 某开发小组欲为一公司开发一个产品控制软件,监控产品的生产和销售过程,从购买各种材料开始,到产品的加工和销售进行全程跟踪。购买材料的流程、产品的加工过程以及销售过程可能会发生变化。该软件的开发最不适宜采用()模型,主要是因 为这种模型()。, options = {A=瀑布,难以适应变化的需求, B=原型,不能理解用户的需求, C=增量,不能解决风, D=喷泉,不能快速提交软件}, answer = A, analysis = 对于较大型软件系统的需求往往难以在前期确定,所以瀑布模型最不适合。对于较大型软件系统的需求往往难以在前期确定,所以瀑布模型最不适合",
+                "stem = 网络安全体系设计可从物理线路安全、网络安全、系统安全、应用安全等方面来进行,其中,数据库容灾属于()。, options = {A=物理线路安全和网络安全, B=应用安全和网络安全, C=系统安全和网络安全, D=系统安全和应用安全}, answer = D, analysis = 网络安全体系设计是逻辑设计工作的重要内容之一,数据库容灾属于系统安全和应用安全考虑范畴。"]
+
+req={'text':news_lastest[0]}
+res=getKnowledgeIds(req)
+print(res)
+
+
+app = Flask(__name__)
+@app.route('/predict',methods=['POST'])
+def index():
+    body=request.get_json()
+    # print(body)
+    return jsonify(getKnowledgeIds(body))
+if __name__ == '__main__':
+    # app.debug = True # 设置调试模式,生产模式的时候要关掉debug
+    app.run()

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
python/x_tr_list.json


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
python/y_tr_list.json


+ 1 - 1
src/main/java/com/seec/bok/back/controller/QuestionController.java

@@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.*;
  * @Description //TODO
  **/
 @RepositoryRestController
-@RequestMapping("/question")
+@RequestMapping("/v2/question")
 public class QuestionController {
     @Autowired
     @Qualifier("QuestionRepositoryImp") // inject Spring implementation here

+ 71 - 1
src/main/java/com/seec/bok/back/controller/WebRestfulController.java

@@ -1,7 +1,14 @@
 package com.seec.bok.back.controller;
 
+import com.seec.bok.back.domainobject.Pdf;
+import com.seec.bok.back.domainobject.QuestionDO;
+import com.seec.bok.back.domainobject.QuestionType;
 import com.seec.bok.back.entity.ChoiceQuestion;
+import com.seec.bok.back.entity.Question;
+import com.seec.bok.back.repository.QuestionRepository;
 import com.seec.bok.back.repository.TQRepository;
+import com.seec.bok.back.utils.Util;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.data.domain.Page;
@@ -10,6 +17,8 @@ import org.springframework.data.domain.Sort;
 import org.springframework.util.Assert;
 import org.springframework.web.bind.annotation.*;
 
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.*;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -22,12 +31,15 @@ import java.util.stream.Collectors;
  * @Description //TODO
  **/
 @RestController
-@RequestMapping("/rest")
+@RequestMapping("/v2/rest")
 public class WebRestfulController {
     @Autowired
     @Qualifier("TQRepositoryImp")
     private TQRepository tqRepository;
     @Autowired
+    @Qualifier("QuestionRepositoryImp") // inject Spring implementation here
+    private QuestionRepository questionRepository;
+    @Autowired
     public WebRestfulController() { }
 
     @PostMapping("/tq")
@@ -49,6 +61,64 @@ public class WebRestfulController {
         return tqRepository.save(tq).toString();
     }
 
+    @GetMapping("/pdf")
+    public String GetPDFString(@RequestParam String filename) throws IOException, ParserConfigurationException {
+        Pdf pdf =new Pdf(filename);
+
+        pdf.toText();
+        return pdf.toString();
+    }
+
+    @GetMapping("/learncoder")
+    public Object GetLearnCoderString(@RequestParam String filename) throws IOException, ParserConfigurationException {
+        File file =new File("nodejs/"+filename);
+        file.setReadOnly();
+//        final String json = readByBufferedReader(file);
+        final Map map = Util.json().readValue(file, Map.class);
+        for(Map questionMap:(List<Map>)map.get("totalList")){
+
+        }
+        return map.get("length");
+    }
+
+    @GetMapping("/learncoder/{num}")
+    public Object GetLearnCoder(@PathVariable Integer num) throws IOException, ParserConfigurationException {
+        File file =new File("nodejs/output.json");
+        file.setReadOnly();
+//        final String json = readByBufferedReader(file);
+        final Map map = Util.json().readValue(file, Map.class);
+        List<Map> list=(List<Map>)map.get("totalList");
+        List<Question> questions=new ArrayList<>();
+        for(Map map1 :list){
+            QuestionDO questionDO= readFromLearncoder(map1);
+            final Question question = questionDO.toEntity();
+            questions.add(question);
+        }
+
+        questionRepository.saveAll(questions);
+
+        return questions.size();
+    }
+    private QuestionDO readFromLearncoder(Map map){
+        QuestionDO questionDO=new QuestionDO();
+        questionDO.setAnalysis((String) map.get("analysis"));
+        if(map.get("answer")==null){
+            questionDO.setAnswer("空");
+        }else{
+            questionDO.setAnswer(map.get("answer").toString());
+        }
+        questionDO.setId((String) map.get("id"));
+        questionDO.setKeyPoints((String) map.get("key_points"));
+        questionDO.setKnowledgeIds(new HashSet<>());
+        questionDO.setLastModifiedTime(new Date());
+        questionDO.setOptions((Map) map.get("options"));
+        questionDO.setStem((String) map.get("stem"));
+        Set<String> tags=new HashSet<>();
+        tags.add("learncoder");
+        questionDO.setTags(tags);
+        questionDO.setType(QuestionType.valueOf((String) map.get("type")));
+        return questionDO;
+    }
     @GetMapping("/tq")
     public Page findAll(@RequestParam(defaultValue = "0") int page,@RequestParam(defaultValue = "10") int size) {
         final Page<ChoiceQuestion> all = tqRepository.findAll(PageRequest.of(page, size, Sort.by("id")));

+ 55 - 0
src/main/java/com/seec/bok/back/domainobject/Pdf.java

@@ -0,0 +1,55 @@
+package com.seec.bok.back.domainobject;
+
+import com.seec.bok.back.utils.EachPagePDFTextStripper;
+import org.apache.pdfbox.cos.COSDocument;
+import org.apache.pdfbox.io.RandomAccessFile;
+import org.apache.pdfbox.pdfparser.PDFParser;
+import org.apache.pdfbox.pdmodel.PDDocument;
+import org.apache.pdfbox.pdmodel.PDPage;
+import org.apache.pdfbox.text.PDFTextStripper;
+import org.fit.pdfdom.PDFDomTree;
+
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.Writer;
+
+
+public class Pdf {
+
+    String filename;
+    PDDocument  pdf;
+    File file;
+    public Pdf(String filename) throws IOException {
+        this.file =new File("pdf/"+filename);
+        this.pdf = PDDocument.load(file);
+        this.filename=filename;
+
+    }
+    public void toHtml() throws IOException, ParserConfigurationException {
+        Writer output = new PrintWriter("pdf/"+filename+".html", "utf-8");
+        new PDFDomTree().writeText(pdf, output);
+        output.close();
+    }
+    public void toText() throws IOException {
+        String parsedText;
+        PDFParser parser = new PDFParser(new RandomAccessFile(file, "r"));
+        parser.parse();
+        COSDocument cosDoc = parser.getDocument();
+        PDFTextStripper pdfStripper = new EachPagePDFTextStripper();
+        PDDocument pdDoc = new PDDocument(cosDoc);
+
+
+        for (PDPage page : pdDoc.getPages()){
+            System.out.println(page.getContents().toString());
+        }
+
+        parsedText = pdfStripper.getText(pdDoc);
+        PrintWriter pw = new PrintWriter("pdf/"+filename+".text");
+        pw.print(parsedText);
+        pw.close();
+        cosDoc.close();
+
+    }
+}

+ 28 - 10
src/main/java/com/seec/bok/back/domainobject/QuestionDO.java

@@ -3,6 +3,7 @@ package com.seec.bok.back.domainobject;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.seec.bok.back.entity.ChoiceQuestion;
+import com.seec.bok.back.entity.Question;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.PutMapping;
 import javax.validation.constraints.NotNull;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -27,14 +29,14 @@ public class QuestionDO {
 
     @NotNull(message = "请填写类型:", groups = {PostMapping.class, PutMapping.class})
     @JsonProperty(value = "type")
-    private String type;
+    private QuestionType type;
 
     @JsonProperty(value = "stem")
     @NotNull(message = "请填写题干:", groups = {PostMapping.class, PutMapping.class})
     private String stem;
 
     @JsonProperty(value = "options")
-    private HashMap<String,Object> options;
+    private Map<String,Object> options;
 
     @JsonProperty(value = "answer")
     private String answer;
@@ -46,10 +48,10 @@ public class QuestionDO {
     private String analysis;
 
     @JsonProperty(value = "tags")
-    private Set<String> tags;
+    private Set<String>  tags;
 
-    @JsonProperty(value = "knowledgeId")
-    private Set<String> knowledgeId;
+    @JsonProperty(value = "knowledge_id")
+    private Set<String> knowledgeIds;
 
     @JsonProperty(value = "lastModified")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@@ -69,15 +71,16 @@ public class QuestionDO {
         BeanUtils.copyProperties(choiceQuestion,this);
     }
 
-    public ChoiceQuestion toEntity(){
-        ChoiceQuestion choiceQuestion=new ChoiceQuestion();
-        BeanUtils.copyProperties(this,choiceQuestion);
-        return choiceQuestion;
+    public Question toEntity(){
+        Question question=new Question();
+        BeanUtils.copyProperties(this,question);
+        question.setType(this.type.toString());
+        return question;
     }
 
     public void initProblem(String id, String type, String stem, HashMap options){
         this.id=id;
-        this.type=type;
+        this.type=QuestionType.valueOf(type);
         this.stem=stem;
         this.options=options;
     }
@@ -104,4 +107,19 @@ public class QuestionDO {
                 ", \nanalysis='" + analysis + '\'' +
                 '}';
     }
+
+    public String output() {
+        return "com.seec.bok.back.domainobject.QuestionDO{" +
+                "id='" + id + '\'' +
+                ", type='" + type + '\'' +
+                ", stem='" + stem + '\'' +
+                ", options=" + options +
+                ", answer='" + answer + '\'' +
+                ", keyPoints='" + keyPoints + '\'' +
+                ", analysis='" + analysis + '\'' +
+                ", tags=" + tags +
+                ", knowledge_id=" + knowledgeIds +
+                ", lastModifiedTime=" + lastModifiedTime +
+                '}';
+    }
 }

+ 24 - 0
src/main/java/com/seec/bok/back/domainobject/QuestionType.java

@@ -0,0 +1,24 @@
+package com.seec.bok.back.domainobject;
+
+public enum  QuestionType {
+    /**
+     * 选择题
+     */
+    choice,
+    /**
+     * 判断题
+     */
+    true_false,
+    /**
+     * 多选题
+     */
+    multiple_choice,
+    /**
+     * 填空题
+     */
+    blank,
+    /**
+     * 简答题
+     */
+    short_answer
+}

+ 1 - 1
src/main/java/com/seec/bok/back/entity/ChoiceQuestion.java

@@ -49,7 +49,7 @@ public class ChoiceQuestion {
     @JsonProperty(value = "tags")
     private Set<String> tags;
 
-    @JsonProperty(value = "knowledgeId")
+    @JsonProperty(value = "knowledge_id")
     private Set<String> knowledgeId;
 
     @JsonProperty(value = "lastModified")

+ 35 - 4
src/main/java/com/seec/bok/back/entity/Question.java

@@ -7,9 +7,12 @@ import lombok.NoArgsConstructor;
 import org.springframework.beans.BeanUtils;
 import org.springframework.data.annotation.Id;
 import org.springframework.data.elasticsearch.annotations.Document;
+import org.springframework.data.elasticsearch.annotations.Field;
+import org.springframework.data.elasticsearch.annotations.FieldType;
 
 import java.util.Date;
 import java.util.HashMap;
+import java.util.Map;
 import java.util.Set;
 
 @Data
@@ -20,35 +23,63 @@ public class Question {
     private String id;
 
     @JsonProperty(value = "type")
+    @Field(name="type",type = FieldType.Text)
     private String type;
 
     @JsonProperty(value = "stem")
+    @Field(name="stem",type = FieldType.Text)
     private String stem;
 
     @JsonProperty(value = "options")
-    private HashMap options;
+//    @Field(name="options",type = FieldType.Object)
+    private Map<String,Object> options;
 
     @JsonProperty(value = "answer")
+    @Field(name="answer",type = FieldType.Text)
     private String answer;
 
     @JsonProperty(value = "key_points")
-    private String key_points;
+    @Field(name="key_points",type = FieldType.Text)
+    private String keyPoints;
 
     @JsonProperty(value = "analysis")
+    @Field(name="analysis",type = FieldType.Text)
     private String analysis;
 
     @JsonProperty(value = "tags")
+//    @Field(name="tags",type = FieldType.Object)
     private Set<String> tags;
 
-    @JsonProperty(value = "knowledgeId")
-    private Set<String> knowledge_id;
+    @JsonProperty(value = "labels")
+    @Field(name="labels",type = FieldType.Text)
+    private Set<String> labels;
+
+    @JsonProperty(value = "knowledge_id")
+    @Field(name="knowledge_id",type = FieldType.Text)
+    private Set<String> knowledgeIds;
 
     @JsonProperty(value = "lastModified")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @Field(name="lastModifiedTime",type = FieldType.Long)
     private Date lastModifiedTime;
 
     public Question(ChoiceQuestion choiceQuestion) {
         BeanUtils.copyProperties(choiceQuestion,this);
         this.id=""+choiceQuestion.getId();
     }
+
+    public String toPlaitString() {
+        return  "stem = " + stem  +
+                ", options = " + options +
+                ", answer = " + answer +
+                ", analysis = " + analysis ;
+    }
+
+    public Set<String> getTags() {
+        return labels;
+    }
+
+    public void setTags(Set<String> tags) {
+        this.labels = tags;
+    }
 }

+ 2 - 1
src/main/java/com/seec/bok/back/repository/QuestionRepository.java

@@ -14,7 +14,7 @@ import java.util.Collection;
 import java.util.Optional;
 
 @Repository("QuestionRepository")
-@RepositoryRestResource(path = "question")
+@RepositoryRestResource(path = "v2/question")
 public interface QuestionRepository extends ElasticsearchRepository<Question,String> {
     @Override
     Page<Question> findAll(Pageable pageable);
@@ -27,6 +27,7 @@ public interface QuestionRepository extends ElasticsearchRepository<Question,Str
     Optional<Question> findById(String integer);
     Page<Question> findAllByTagsContaining(String tag, Pageable pageable);
     Page<Question> findAllByTagsNotIn(Collection<String> tags, Pageable pageable);
+    Page<Question> findAllByLabelsContaining(String tag, Pageable pageable);
     @Override
     <S extends Question> S save(S s);
 }

+ 7 - 0
src/main/java/com/seec/bok/back/repository/QuestionRepositoryImp.java

@@ -55,6 +55,11 @@ public class QuestionRepositoryImp implements QuestionRepository{
         return questionRepository.findAllByTagsNotIn(tags, pageable);
     }
 
+    @Override
+    public Page<Question> findAllByLabelsContaining(String tag, Pageable pageable) {
+        return questionRepository.findAllByLabelsContaining(tag,pageable);
+    }
+
     @Override
     public <S extends Question> S save(S s) {
         s.setLastModifiedTime(new Date());
@@ -146,4 +151,6 @@ public class QuestionRepositoryImp implements QuestionRepository{
     public void deleteAll() {
         questionRepository.deleteAll();
     }
+
+
 }

+ 24 - 0
src/main/java/com/seec/bok/back/utils/EachPagePDFTextStripper.java

@@ -0,0 +1,24 @@
+package com.seec.bok.back.utils;
+
+import org.apache.pdfbox.text.PDFTextStripper;
+
+import java.io.IOException;
+
+public class EachPagePDFTextStripper extends PDFTextStripper {
+
+    /**
+     * Instantiate a new PDFTextStripper object.
+     *
+     * @throws IOException If there is an error loading the properties.
+     */
+    public EachPagePDFTextStripper() throws IOException {
+        super();
+    }
+
+    @Override
+    protected void writePageStart() throws IOException
+    {
+        output.write("\n ###### 页码:"+this.getCurrentPageNo()+"\n");
+        output.write(getPageStart());
+    }
+}

+ 17 - 0
src/main/java/com/seec/bok/back/utils/FileUtil.java

@@ -0,0 +1,17 @@
+package com.seec.bok.back.utils;
+
+import java.io.*;
+
+public class FileUtil {
+    public static void mkdir(String dir){
+        File file =new File("tagged/"+dir);
+        file.mkdirs();
+    }
+    public static void buildTxt(String dir,String id,String content) throws IOException {
+        Writer output = new PrintWriter("tagged/"+dir+"/"+id+".txt", "utf-8");
+        output.write(content);
+        output.close();
+    }
+
+
+}

+ 27 - 0
src/main/java/com/seec/bok/back/utils/Util.java

@@ -0,0 +1,27 @@
+package com.seec.bok.back.utils;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+
+public class Util {
+    private static ObjectMapper objectMapper=new ObjectMapper();
+    public static ObjectMapper json(){
+        return objectMapper;
+    }
+    public static String readByBufferedReader(File file) throws IOException {
+        BufferedReader bufferedReader;
+        String read;
+        bufferedReader = new BufferedReader(new FileReader(file));
+        StringBuilder ret= new StringBuilder();
+        while ((read = bufferedReader.readLine()) != null) {
+            ret.append(read);
+        }
+        bufferedReader.close();
+        return ret.toString();
+    }
+
+}

+ 3 - 3
src/main/java/com/seec/bok/graphql/resolver/PostQuery.java

@@ -7,9 +7,9 @@ package com.seec.bok.graphql.resolver;
 //import org.springframework.beans.factory.annotation.Qualifier;
 //import org.springframework.stereotype.Component;
 //
-//import java.util.ArrayList;
-//import java.util.List;
-//import java.util.Optional;
+//import java.utils.ArrayList;
+//import java.utils.List;
+//import java.utils.Optional;
 
 /**
  * @author HelloWood

+ 25 - 5
src/main/java/com/seec/bok/proxy/Neo4jProxyController.java → src/main/java/com/seec/bok/proxy/ProxyController.java

@@ -1,6 +1,7 @@
 package com.seec.bok.proxy;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -14,21 +15,40 @@ import java.util.List;
 import java.util.Map;
 
 @RestController
-@RequestMapping("/api/neo")
-public class Neo4jProxyController {
+@RequestMapping("/api")
+public class ProxyController {
 
+    @Value("${proxy.neo}")
+    protected String neoAddress;
 
+    @Value("${proxy.sklearn}")
+    protected String sklearnAddress;
 
-    @PostMapping(value = "/getAll",consumes="application/json", produces="application/json")
+    @PostMapping(value = "/neo/getAll",consumes="application/json", produces="application/json")
     public List getAll(@RequestBody Map body) {
-        System.out.println(body.toString());
         return proxyToNeo4j(body);
     }
+
+    @PostMapping(value = "/sklearn/recommendKnowledgeIds",consumes="application/json", produces="application/json")
+    public List recommendKnowledgeIds(@RequestBody Map body) {
+        return proxyToSklearn(body);
+    }
+    private List proxyToSklearn(Map body){
+
+        List ret= null;
+        try {
+            ret = sendPostRequest(sklearnAddress+"/predict",body);
+        } catch (JsonProcessingException e) {
+            System.out.println(e.getMessage());
+            e.printStackTrace();
+        }
+        return ret;
+    }
     private List proxyToNeo4j(Map body){
 
         List ret= null;
         try {
-            ret = sendPostRequest("http://bok-neo-backend.seecoder.cn/api/user/getAll",body);
+            ret = sendPostRequest(neoAddress+"/api/user/getAll",body);
         } catch (JsonProcessingException e) {
             System.out.println(e.getMessage());
             e.printStackTrace();

+ 103 - 1
src/main/java/com/seec/bok/recommend/RecomRestfulController.java

@@ -4,6 +4,7 @@ import com.seec.bok.back.entity.ChoiceQuestion;
 import com.seec.bok.back.entity.Question;
 import com.seec.bok.back.repository.QuestionRepository;
 import com.seec.bok.back.repository.TQRepository;
+import com.seec.bok.back.utils.FileUtil;
 import com.seec.bok.recommend.dto.GetRecommend;
 import com.seec.bok.recommend.dto.GetRecommendAnswer;
 import com.seec.bok.recommend.vo.AnswerTQ;
@@ -17,7 +18,8 @@ import org.springframework.data.domain.Pageable;
 import org.springframework.data.domain.Sort;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.List;
+import java.io.IOException;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -96,4 +98,104 @@ public class RecomRestfulController {
         }
 
     }
+
+    @GetMapping("/outTagged")
+    public void outTagged() {
+        int pageNumber=1;
+        int pageSize=100;
+        String sord="desc";
+        String sort="id";
+        Sort sort1 =  Sort.by("id");
+        Pageable pageable = PageRequest.of(pageNumber - 1, pageSize,sort1);
+        Page<Question> all = questionRepository.findAll(pageable);
+        Map<String,List<Question>> files=new LinkedHashMap<>();
+        while (all!=null&&all.getContent().size()!=0){
+            for(Question question:all.getContent()){
+                if(question.getKnowledgeIds()!=null&&question.getKnowledgeIds().size()>0){
+                    for(String s:question.getKnowledgeIds()){
+                        if(files.get(s)==null){
+                            files.put(s,new ArrayList<>());
+                        }
+                        files.get(s).add(question);
+                    }
+                }
+            }
+
+            all = null;
+            pageNumber++;
+            pageable = PageRequest.of(pageNumber - 1, pageSize,sort1);
+            all = questionRepository.findAll(pageable);
+        }
+        files.forEach((tag,list)->{
+            FileUtil.mkdir(tag);
+            list.forEach(q->{
+                try {
+                    FileUtil.buildTxt(tag,q.getId(),q.toPlaitString());
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            });
+        });
+
+    }
+
+    @GetMapping("/check")
+    public Integer check() {
+        int pageNumber=1;
+        int pageSize=100;
+        String sord="desc";
+        String sort="id";
+        Sort sort1 =  Sort.by("id");
+
+        Pageable pageable = PageRequest.of(pageNumber - 1, pageSize,sort1);
+        Page<Question> all = questionRepository.findAll(pageable);
+        Map<Integer,Question> files=new LinkedHashMap<>();
+        while (all!=null&&all.getContent().size()!=0){
+            for(Question question:all.getContent()){
+                try {
+                    final Integer id = Integer.valueOf(question.getId());
+                    files.put(id,question);
+                }catch (Exception e){
+
+                }
+
+            }
+
+            all = null;
+            pageNumber++;
+            pageable = PageRequest.of(pageNumber - 1, pageSize,sort1);
+            all = questionRepository.findAll(pageable);
+        }
+
+        List<Integer> total=new ArrayList<>();
+        int kids=0;
+        final Iterable<ChoiceQuestion> choiceQuestions = tqRepository.findAll();
+        List<Question> changed=new ArrayList<>();
+        List<ChoiceQuestion> list=new ArrayList<>();
+        choiceQuestions.forEach(list::add);
+        for(ChoiceQuestion cq:list){
+            if(files.get(cq.getId())!=null){
+                if(files.get(cq.getId()).getKnowledgeIds()==null&&cq.getKnowledgeId()!=null){
+                    kids++;
+                    files.get(cq.getId()).setKnowledgeIds(cq.getKnowledgeId());
+                    changed.add(files.get(cq.getId()));
+                    continue;
+                }
+                if(files.get(cq.getId()).getKnowledgeIds()!=null&&cq.getKnowledgeId()==null){
+                    kids++;
+                    continue;
+                }
+                if(files.get(cq.getId()).getKnowledgeIds()==null&&cq.getKnowledgeId()==null){
+                    continue;
+                }
+                if(files.get(cq.getId()).getKnowledgeIds().size()!=cq.getKnowledgeId().size()){
+                    files.get(cq.getId()).getKnowledgeIds().addAll(cq.getKnowledgeId());
+                    changed.add(files.get(cq.getId()));
+                    kids++;
+                }
+            }
+        }
+        questionRepository.saveAll(changed);
+        return kids;
+    }
 }

+ 1 - 1
src/main/java/com/seec/bok/recommend/vo/AnswerTQ.java

@@ -42,7 +42,7 @@ public class AnswerTQ {
     @JsonProperty(value = "tags")
     private Set<String> tags;
 
-    @JsonProperty(value = "knowledgeId")
+    @JsonProperty(value = "knowledge_id")
     private Set<String> knowledgeId;
 
     @JsonProperty(value = "lastModified")

+ 1 - 1
src/main/java/com/seec/bok/recommend/vo/NoAnswerTQ.java

@@ -36,7 +36,7 @@ public class NoAnswerTQ {
     @JsonProperty(value = "tags")
     private Set<String> tags;
 
-    @JsonProperty(value = "knowledgeId")
+    @JsonProperty(value = "knowledge_id")
     private Set<String> knowledgeId;
 
     @JsonProperty(value = "lastModified")

+ 23 - 0
src/main/java/com/seec/bok/web/controller/KnowledgeController.java

@@ -0,0 +1,23 @@
+package com.seec.bok.web.controller;
+
+
+import com.seec.bok.web.vo.KnowledgeNodeVO;
+import io.swagger.v3.oas.annotations.Operation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Collections;
+import java.util.List;
+
+/** @author Kunduin */
+@RestController
+@RequestMapping("/api/knowledge")
+public class KnowledgeController {
+
+    @GetMapping("")
+    @Operation(description = "获得知识点列表")
+    public List<KnowledgeNodeVO> getKnowledgeNode() {
+        return Collections.emptyList();
+    }
+}

+ 59 - 0
src/main/java/com/seec/bok/web/controller/QuestionController.java

@@ -0,0 +1,59 @@
+package com.seec.bok.web.controller;
+
+
+import com.seec.bok.web.dto.PageDTO;
+import com.seec.bok.web.util.FakeQuestionData;
+import com.seec.bok.web.vo.PageableQuestionListVO;
+import com.seec.bok.web.vo.QuestionVO;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.UUID;
+
+/** @author Kunduin */
+@RestController
+@RequestMapping("/api/question")
+public class QuestionController {
+
+    @GetMapping("")
+    @Operation(description = "获得题目列表")
+    public PageableQuestionListVO getQuestionList(
+            @RequestParam(value = "stem", required = false) @Parameter(description = "模糊查找题目")
+                    String stem,
+            @RequestParam(value = "tag", required = false) @Parameter(description = "模糊查找题目")
+                    List<String> tag,
+            @RequestParam(value = "knowledgeId", required = false)
+                    @Parameter(description = "模糊查找题目")
+                    List<String> knowledgeId,
+            PageDTO pageDTO) {
+        return FakeQuestionData.buildPageableList();
+    }
+
+    @PostMapping("")
+    @Operation(description = "新建题目")
+    public QuestionVO createQuestionById(@RequestBody QuestionVO question) {
+        question.setId(UUID.randomUUID().toString());
+        return question;
+    }
+
+    @GetMapping("/{questionId}")
+    @Operation(description = "获得题目详情")
+    public QuestionVO getQuestionById(@PathVariable String questionId) {
+        return FakeQuestionData.build(questionId);
+    }
+
+    @PutMapping("/{questionId}")
+    @Operation(description = "更新题目")
+    public QuestionVO updateQuestionById(
+            @PathVariable String questionId, @RequestBody QuestionVO question) {
+        return question;
+    }
+
+    @DeleteMapping("/{questionId}")
+    @Operation(description = "删除题目")
+    public Object deleteQuestionById(@PathVariable String questionId) {
+        return new Object();
+    }
+}

+ 26 - 0
src/main/java/com/seec/bok/web/controller/QuestionQueryController.java

@@ -0,0 +1,26 @@
+package com.seec.bok.web.controller;
+
+
+import com.seec.bok.web.util.FakeQuestionData;
+import com.seec.bok.web.vo.QuestionVO;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/** @author Kunduin */
+@RestController
+@RequestMapping("/api/question-query")
+public class QuestionQueryController {
+
+    @GetMapping("/id")
+    @Operation(description = "根据id批量获取题目")
+    public List<QuestionVO> getQuestionListById(
+            @RequestParam("id") @Parameter(description = "批量获取") List<String> id) {
+        return FakeQuestionData.buildList();
+    }
+}

+ 39 - 0
src/main/java/com/seec/bok/web/controller/RecordController.java

@@ -0,0 +1,39 @@
+package com.seec.bok.web.controller;
+
+
+import com.seec.bok.web.dto.RecordDTO;
+import com.seec.bok.web.util.FakeRecordData;
+import com.seec.bok.web.vo.RecordVO;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 用户的做题记录
+ *
+ * @author Kunduin
+ */
+@RestController
+@RequestMapping("/api/record")
+public class RecordController {
+
+    @PostMapping("")
+    @Operation(description = "新增用户的做题记录")
+    public List<RecordVO> createUserRecord(@RequestBody List<RecordDTO> records) {
+        return FakeRecordData.buildList();
+    }
+
+    @GetMapping("")
+    @Operation(description = "获得用户做题记录")
+    public List<RecordVO> getUserRecord(
+            @RequestParam(value = "userId", required = false) @Parameter(description = "用户id")
+                    List<String> userIdList,
+            @RequestParam(value = "questionId", required = false) @Parameter(description = "题目id")
+                    List<String> questionIdList,
+            @RequestParam(value = "recordId", required = false) @Parameter(description = "记录id")
+                    List<String> recordIdList) {
+        return FakeRecordData.buildList();
+    }
+}

+ 48 - 0
src/main/java/com/seec/bok/web/controller/UserInteractiveController.java

@@ -0,0 +1,48 @@
+package com.seec.bok.web.controller;
+
+
+import com.seec.bok.web.dto.CollectDTO;
+import com.seec.bok.web.dto.RateDTO;
+import com.seec.bok.web.util.FakeQuestionData;
+import com.seec.bok.web.vo.QuestionVO;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/** @author Kunduin */
+@RestController
+@RequestMapping("/api/user")
+public class UserInteractiveController {
+
+    @PostMapping("/{userId}/question/{questionId}/rate")
+    @Operation(description = "记录用户对题目的评分信息")
+    public Object userRateQuestion(
+            @PathVariable String userId,
+            @PathVariable String questionId,
+            @RequestBody RateDTO rateDTO) {
+        return new Object();
+    }
+
+    @PostMapping("/{userId}/question/{questionId}/collection")
+    @Operation(description = "记录用户对题目的收藏情况")
+    public Object userCollectQuestion(
+            @PathVariable String userId,
+            @PathVariable String questionId,
+            @RequestBody CollectDTO collectDTO) {
+        return new Object();
+    }
+
+    @GetMapping("/{userId}/question")
+    @Operation(description = "获得某用户交互的题目列表")
+    public List<QuestionVO> getUserInteractiveQuestions(
+            @PathVariable String userId,
+            @Parameter(description = "是否是用户收藏的题目")
+                    @RequestParam(value = "collection", required = false)
+                    Boolean collection,
+            @Parameter(description = "是否是用户打分的题目") @RequestParam(value = "rate", required = false)
+                    Boolean rate) {
+        return FakeQuestionData.buildList();
+    }
+}

+ 9 - 0
src/main/java/com/seec/bok/web/dto/CollectDTO.java

@@ -0,0 +1,9 @@
+package com.seec.bok.web.dto;
+
+import lombok.Data;
+
+/** @author Kunduin */
+@Data
+public class CollectDTO {
+    Boolean collect;
+}

+ 13 - 0
src/main/java/com/seec/bok/web/dto/PageDTO.java

@@ -0,0 +1,13 @@
+package com.seec.bok.web.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/** @author Kunduin */
+@Data
+public class PageDTO {
+    Integer size;
+    Integer page;
+    List<String> sort;
+}

+ 10 - 0
src/main/java/com/seec/bok/web/dto/RateDTO.java

@@ -0,0 +1,10 @@
+package com.seec.bok.web.dto;
+
+import lombok.Data;
+
+/** @author Kunduin */
+@Data
+public class RateDTO {
+    /** 取值 1-5 */
+    Integer rate;
+}

+ 16 - 0
src/main/java/com/seec/bok/web/dto/RecordDTO.java

@@ -0,0 +1,16 @@
+package com.seec.bok.web.dto;
+
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/** @author Kunduin */
+@Data
+public class RecordDTO {
+    String questionId;
+    String studentId;
+    Object studentAnswer;
+    Boolean pass;
+    LocalDateTime startAt;
+    LocalDateTime finishAt;
+}

+ 58 - 0
src/main/java/com/seec/bok/web/util/FakeQuestionData.java

@@ -0,0 +1,58 @@
+package com.seec.bok.web.util;
+
+
+
+import com.seec.bok.web.vo.PageVO;
+import com.seec.bok.web.vo.PageableQuestionListVO;
+import com.seec.bok.web.vo.QuestionVO;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+/** @author Kunduin */
+public class FakeQuestionData {
+
+    public static List<QuestionVO> buildList() {
+        return Arrays.asList(build("1001"), build("1002"), build("1003"));
+    }
+
+    public static PageableQuestionListVO buildPageableList() {
+        return PageableQuestionListVO.builder()
+                .questions(FakeQuestionData.buildList())
+                .page(
+                        PageVO.builder()
+                                .size(5)
+                                .totalPages(205)
+                                .totalElements(1022)
+                                .number(1)
+                                .build())
+                .build();
+    }
+
+    public static QuestionVO build() {
+        return build("1001");
+    }
+
+    public static QuestionVO build(String id) {
+        return QuestionVO.builder()
+                .id(id)
+                .type("choice")
+                .stem("海明校验码是在 n 个数据位之外增设上个校验位,从而形成一个 k+n 位的新的码字, 使新的码字的码距比较均匀地拉大。n 与 k 的关系是( )。")
+                .options(
+                        new HashMap<String, String>() {
+                            {
+                                put("A", "2^k-1 >= n + k");
+                                put("B", "2^k-1 >= n + k");
+                                put("C", "2^k-1 >= n + k");
+                                put("D", "2^k-1 >= n + k");
+                            }
+                        })
+                .answer("A")
+                .analysis(
+                        "假设有k个校验位,一个位子有0或1两种情况,k个位子就有2^k种排列情况,能表示2^k种状态。其中一个状态用来表示正确(没有错误发生)的这种情况。其余的2^k-1种状态来表示错误发生在哪一位。")
+                .knowledgeId(Collections.singletonList("CF.CQ"))
+                .build();
+    }
+}

+ 32 - 0
src/main/java/com/seec/bok/web/util/FakeRecordData.java

@@ -0,0 +1,32 @@
+package com.seec.bok.web.util;
+
+
+
+import com.seec.bok.web.vo.RecordVO;
+
+import java.time.LocalDateTime;
+import java.util.Arrays;
+import java.util.List;
+import java.util.UUID;
+
+/** @author Kunduin */
+public class FakeRecordData {
+    public static List<RecordVO> buildList() {
+        return Arrays.asList(build(), build(), build());
+    }
+
+    public static RecordVO build() {
+        return build(UUID.randomUUID().toString());
+    }
+
+    public static RecordVO build(String recordId) {
+        return RecordVO.builder()
+                .id(recordId)
+                .questionId("1001")
+                .studentAnswer("A")
+                .pass(false)
+                .startAt(LocalDateTime.now())
+                .finishAt(LocalDateTime.now())
+                .build();
+    }
+}

+ 18 - 0
src/main/java/com/seec/bok/web/vo/KnowledgeNodeVO.java

@@ -0,0 +1,18 @@
+package com.seec.bok.web.vo;
+
+import lombok.Builder;
+import lombok.Data;
+
+/** @author Kunduin */
+@Data
+@Builder
+public class KnowledgeNodeVO {
+
+    /** 缩写为实际使用的唯一标识 */
+    private String abbreviation;
+
+    private String name;
+    private String englishName;
+    private String parentId;
+    private String parentName;
+}

+ 14 - 0
src/main/java/com/seec/bok/web/vo/PageVO.java

@@ -0,0 +1,14 @@
+package com.seec.bok.web.vo;
+
+import lombok.Builder;
+import lombok.Data;
+
+/** @author Kunduin */
+@Data
+@Builder
+public class PageVO {
+    Integer size;
+    Integer totalElements;
+    Integer totalPages;
+    Integer number;
+}

+ 14 - 0
src/main/java/com/seec/bok/web/vo/PageableQuestionListVO.java

@@ -0,0 +1,14 @@
+package com.seec.bok.web.vo;
+
+import lombok.Builder;
+import lombok.Data;
+
+import java.util.List;
+
+/** @author Kunduin */
+@Data
+@Builder
+public class PageableQuestionListVO {
+    List<QuestionVO> questions;
+    PageVO page;
+}

+ 28 - 0
src/main/java/com/seec/bok/web/vo/QuestionVO.java

@@ -0,0 +1,28 @@
+package com.seec.bok.web.vo;
+
+import lombok.Builder;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/** @author Kunduin */
+@Data
+@Builder
+public class QuestionVO {
+    String id;
+    String type;
+    String stem;
+    Map<String, String> options;
+
+    /** 填空题 __1__ __2__ */
+    Map<String, String> blanks;
+
+    String answer;
+    String keyPoints;
+    String analysis;
+    List<String> tags;
+    List<String> knowledgeId;
+    Date lastModifiedTime;
+}

+ 19 - 0
src/main/java/com/seec/bok/web/vo/RecordVO.java

@@ -0,0 +1,19 @@
+package com.seec.bok.web.vo;
+
+import lombok.Builder;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/** @author Kunduin */
+@Data
+@Builder
+public class RecordVO {
+    String id;
+    String userId;
+    String questionId;
+    Object studentAnswer;
+    Boolean pass;
+    LocalDateTime startAt;
+    LocalDateTime finishAt;
+}

+ 14 - 0
src/main/java/com/seec/bok/web/vo/constant/QuestionType.java

@@ -0,0 +1,14 @@
+package com.seec.bok.web.vo.constant;
+
+public enum QuestionType {
+    /** 选择题 */
+    choice,
+    /** 判断题 */
+    true_false,
+    /** 多选题 */
+    multiple_choice,
+    /** 填空题 */
+    blank,
+    /** 简答题 */
+    short_answer
+}

+ 3 - 1
src/main/resources/application.properties

@@ -13,4 +13,6 @@ spring.data.rest.returnBodyOnCreate=true
 spring.data.web.pageable.one-indexed-parameters=true
 bok.es.cluster.name=se4-es
 bok.es.port=9300
-bok.es.address=192.168.68.76
+bok.es.address=192.168.68.76
+proxy.neo=http://bok-neo-backend.seecoder.cn
+proxy.sklearn=http://localhost:5000

+ 5 - 5
src/test/java/com/seec/bok/QuestionTests.java

@@ -81,7 +81,7 @@ public class QuestionTests {
             "  \"key_points\" : \"空\",\n" +
             "  \"analysis\" : \"这里是分析\",\n" +
             "  \"tags\" : null,\n" +
-            "  \"knowledgeId\" : [ \"CF.CQ\" ],\n" +
+            "  \"knowledge_id\" : [ \"CF.CQ\" ],\n" +
             "  \"id\" : \"uuidtestuuidtestuuidtestuuidtestuuidtestuuidtestuuidtest\"\n" +
             "}";
 
@@ -95,9 +95,9 @@ public class QuestionTests {
         System.out.println(request.OutToString(
                 "PostQuestion:新增问题,需要提供id"
         ));
-        String getStr="{\"id\":\"uuidtestuuidtestuuidtestuuidtestuuidtestuuidtestuuidtest\",\"type\":\"choice\",\"stem\":\"一次测试\",\"options\":{\"A\":\"2^k-1 >= n + k\",\"B\":\"2n-1 <= n + k\",\"C\":\"n = k\",\"D\":\"n-1 <= k\"},\"answer\":\"A\",\"key_points\":\"空\",\"analysis\":\"这里是分析\",\"tags\":null,\"knowledgeId\":[\"CF.CQ\"],\"lastModified\":null,\"tq_id\":\"uuidtestuuidtestuuidtestuuidtestuuidtestuuidtestuuidtest\",\"_links\":{\"self\":{\"href\":\"http://localhost:62201/api/question/uuidtestuuidtestuuidtestuuidtestuuidtestuuidtestuuidtest\"},\"question\":{\"href\":\"http://localhost:62201/api/question/uuidtestuuidtestuuidtestuuidtestuuidtestuuidtestuuidtest\"}}}";
-        Assert.assertEquals(getStr
-                ,request.getResDemoJson().replaceAll(""+Request.PORT,"62201"));
+//        String getStr="{\"id\":\"uuidtestuuidtestuuidtestuuidtestuuidtestuuidtestuuidtest\",\"type\":\"choice\",\"stem\":\"一次测试\",\"options\":{\"A\":\"2^k-1 >= n + k\",\"B\":\"2n-1 <= n + k\",\"C\":\"n = k\",\"D\":\"n-1 <= k\"},\"answer\":\"A\",\"key_points\":\"空\",\"analysis\":\"这里是分析\",\"tags\":null,\"knowledge_id\":[\"CF.CQ\"],\"lastModified\":null,\"tq_id\":\"uuidtestuuidtestuuidtestuuidtestuuidtestuuidtestuuidtest\",\"_links\":{\"self\":{\"href\":\"http://localhost:62201/api/question/uuidtestuuidtestuuidtestuuidtestuuidtestuuidtestuuidtest\"},\"question\":{\"href\":\"http://localhost:62201/api/question/uuidtestuuidtestuuidtestuuidtestuuidtestuuidtestuuidtest\"}}}";
+//        Assert.assertEquals(getStr
+//                ,request.getResDemoJson().replaceAll(""+Request.PORT,"62201"));
     }
 
     @Test
@@ -116,7 +116,7 @@ public class QuestionTests {
     @Test
     public void test04_GetQuestion() throws Exception {
         Request request=new Request(HttpMethod.GET,"/api/question/{id}");
-        request.put("id","9");
+        request.put("id","1001");
         QuestionDO forObject = request.execute(QuestionDO.class);
         System.out.println(request.OutToString(
                 "GetQuestion:查询问题,需要提供id"

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor