正则匹配输入的英文文本
This commit is contained in:
@@ -3302,6 +3302,10 @@ public class PythonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String promptTranslate(String text) throws BusinessException {
|
public String promptTranslate(String text) throws BusinessException {
|
||||||
|
if (text.matches("^[a-zA-Z\\s,.!?'-]+$")){
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
OkHttpClient client = new OkHttpClient().newBuilder()
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||||
.connectTimeout(30, TimeUnit.SECONDS)
|
.connectTimeout(30, TimeUnit.SECONDS)
|
||||||
.pingInterval(5, TimeUnit.SECONDS)//websocket轮训间隔(单位:秒)
|
.pingInterval(5, TimeUnit.SECONDS)//websocket轮训间隔(单位:秒)
|
||||||
|
|||||||
Reference in New Issue
Block a user