|
|
|
@ -112,6 +112,13 @@ public class DocInfoController extends BaseController {
|
|
|
|
|
result.put("labelCategories", MyObjects.labelCategories);
|
|
|
|
|
Sentence sentence = DependencyParserUtils.nerAnalysis(content);
|
|
|
|
|
List<IWord> wordList = sentence.wordList;
|
|
|
|
|
int noun=0;
|
|
|
|
|
int personalName=0;
|
|
|
|
|
int placeName=0;
|
|
|
|
|
int InstitutionalGroup=0;
|
|
|
|
|
int verb=0;
|
|
|
|
|
int adjective=0;
|
|
|
|
|
int adverb=0;
|
|
|
|
|
if(wordList!=null&&wordList.size()>0){
|
|
|
|
|
int offset = 0;
|
|
|
|
|
int id = 0;
|
|
|
|
@ -124,6 +131,21 @@ public class DocInfoController extends BaseController {
|
|
|
|
|
Integer categoryId = MyObjects.wordsMapping.get(label);
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
jsonObject.put("id",id);
|
|
|
|
|
if(categoryId==0){
|
|
|
|
|
noun++;
|
|
|
|
|
}else if(categoryId==1){
|
|
|
|
|
personalName++;
|
|
|
|
|
}else if(categoryId==2){
|
|
|
|
|
placeName++;
|
|
|
|
|
}else if(categoryId==3){
|
|
|
|
|
InstitutionalGroup++;
|
|
|
|
|
}else if(categoryId==4){
|
|
|
|
|
verb++;
|
|
|
|
|
}else if(categoryId==5){
|
|
|
|
|
adjective++;
|
|
|
|
|
}else if(categoryId==6){
|
|
|
|
|
adverb++;
|
|
|
|
|
}
|
|
|
|
|
jsonObject.put("categoryId",categoryId);
|
|
|
|
|
jsonObject.put("startIndex",startIndex);
|
|
|
|
|
jsonObject.put("endIndex",endIndex);
|
|
|
|
@ -134,6 +156,13 @@ public class DocInfoController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
result.put("labels",labels);
|
|
|
|
|
}
|
|
|
|
|
result.put("noun",noun);
|
|
|
|
|
result.put("personalName",personalName);
|
|
|
|
|
result.put("placeName",placeName);
|
|
|
|
|
result.put("institutionalGroup",InstitutionalGroup);
|
|
|
|
|
result.put("verb",verb);
|
|
|
|
|
result.put("adjective",adjective);
|
|
|
|
|
result.put("adverb",adverb);
|
|
|
|
|
return AjaxResult.success("查询成功",result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|