|
@@ -177,12 +177,16 @@ public class EntityProcess {
|
|
|
if (relationObjs.getIntValue("from") == entityId) {
|
|
|
Relation relation = new Relation();
|
|
|
relation.setId(relationObjs.getIntValue("to"));
|
|
|
+ relation.setFrom(relationObjs.getIntValue("from"));
|
|
|
+ relation.setTo(relationObjs.getIntValue("to"));
|
|
|
relation.setRelationName(relationObjs.getString("name"));
|
|
|
connectEntityList.add(relation);
|
|
|
}
|
|
|
if (relationObjs.getIntValue("to") == entityId) {
|
|
|
Relation relation = new Relation();
|
|
|
relation.setId(relationObjs.getIntValue("from"));
|
|
|
+ relation.setFrom(relationObjs.getIntValue("from"));
|
|
|
+ relation.setTo(relationObjs.getIntValue("to"));
|
|
|
relation.setRelationName(relationObjs.getString("name"));
|
|
|
connectEntityList.add(relation);
|
|
|
}
|
|
@@ -191,16 +195,20 @@ public class EntityProcess {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 查找阴性表述
|
|
|
+ * 查找阴性表述, 阴性词需要在实体前面
|
|
|
* @param detailLemma
|
|
|
* @return
|
|
|
*/
|
|
|
protected Negative findNegative(Lemma detailLemma) {
|
|
|
for (Lemma lemma : detailLemma.getRelationLemmas()) {
|
|
|
if (lemma.getProperty().equals(EntityEnum.NEGATIVE.toString())) {
|
|
|
- Negative negative = new Negative();
|
|
|
- negative.setName(lemma.getText());
|
|
|
- return negative;
|
|
|
+ if (StringUtils.isNotEmpty(lemma.getPosition()) && StringUtils.isNotEmpty(detailLemma.getPosition())) {
|
|
|
+ if (Integer.parseInt(detailLemma.getPosition()) > Integer.parseInt(lemma.getPosition())) {
|
|
|
+ Negative negative = new Negative();
|
|
|
+ negative.setName(lemma.getText());
|
|
|
+ return negative;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return null;
|