修改根据已知数据获取未知数据的问题
This commit is contained in:
parent
ca6870ae17
commit
1ef8a6e41e
@ -153,19 +153,35 @@ public enum ExtractRule {
|
||||
throw new IllegalArgumentException("定位参数缺失");
|
||||
}
|
||||
ParamExtractResult result = new ParamExtractResult();
|
||||
String way = originArr[0];
|
||||
if (correctArr != null && correctArr[0] != null) { // 有正确值,直接匹配
|
||||
result.setValue(correctArr[0]);
|
||||
} else {
|
||||
String way = originArr[0];
|
||||
if(StringUtils.containsIgnoreCase(way,"shang")) {
|
||||
result.setValue(true);
|
||||
result.setCorrectGroupMap(way, "上");
|
||||
}else if(StringUtils.containsIgnoreCase(way,"xia")){
|
||||
result.setValue(false);
|
||||
result.setCorrectGroupMap(way, "下");
|
||||
String correctArrStr = correctArr[0];
|
||||
boolean isRight = true;
|
||||
if(StringUtils.equals(correctArrStr,"下")){
|
||||
isRight = false;
|
||||
}
|
||||
result.setValue(isRight);
|
||||
result.setCorrectGroupMap(way,isRight ? "上" : "下");
|
||||
return result;
|
||||
} else {
|
||||
Boolean isRight = null;
|
||||
if(StringUtils.containsIgnoreCase(way,"shang")) {
|
||||
isRight = true;
|
||||
// result.setValue(true);
|
||||
// result.setCorrectGroupMap(way, "上");
|
||||
// return result;
|
||||
}else if(StringUtils.containsIgnoreCase(way,"xia")){
|
||||
isRight = false;
|
||||
// result.setValue(false);
|
||||
// result.setCorrectGroupMap(way, "下");
|
||||
// return result;
|
||||
}else{
|
||||
throw new IllegalArgumentException(String.format("不能解析上下行[%s]", originArr[0]));
|
||||
}
|
||||
result.setValue(isRight);
|
||||
result.setCorrectGroupMap(way,isRight ? "上" : "下");
|
||||
return result;
|
||||
}
|
||||
throw new IllegalArgumentException(String.format("不能解析上下行[%s]", originArr[0]));
|
||||
}
|
||||
},
|
||||
SWITCH_NAME("道岔名称"){
|
||||
|
@ -153,8 +153,11 @@ public class VoiceConfigDataTest {
|
||||
public void saveForStand(){
|
||||
// this.service.saveOrUpdate();
|
||||
VoiceDiscriminateConfigVO configVO = new VoiceDiscriminateConfigVO();
|
||||
configVO.setId(4L);
|
||||
configVO.setDescribe("测试站台扣车");
|
||||
configVO.setKeyWordRules("(.*?)站(.*?)站台扣车");
|
||||
|
||||
// ^(?:BANLI|CHULI)(.*?ZHAN(?:YI|ER))ZHAN(.*?)ZHANTAIKOUCHE
|
||||
configVO.setKeyWordRules("^(?:办理|处理)(.*?站(?:一|二))站(.*?)站台扣车");
|
||||
configVO.setMapId(63L);
|
||||
List<ParamExtractRule> paramExtractRuleList = new ArrayList<>();
|
||||
ParamExtractRule extractRule = new ParamExtractRule();
|
||||
|
Loading…
Reference in New Issue
Block a user