Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
qwgame
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵国君
qwgame
Commits
dab996fa
Commit
dab996fa
authored
Apr 22, 2019
by
赵国君
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
属性更新问题修复
parent
f4ead641
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
47 deletions
+23
-47
ActionUtils.java
...qiwu/chatbotbackend/actiongenerate/utils/ActionUtils.java
+2
-2
ElementConstructor.java
...om/qiwu/chatbotbackend/gameDesign/ElementConstructor.java
+0
-43
ActionMatcher.java
...ava/com/qiwu/chatbotbackend/processing/ActionMatcher.java
+20
-1
ChatCacheTests.java
src/test/java/com/qiwu/chatbotbackend/ChatCacheTests.java
+1
-1
No files found.
src/main/java/com/qiwu/chatbotbackend/actiongenerate/utils/ActionUtils.java
View file @
dab996fa
...
@@ -1025,7 +1025,7 @@ public class ActionUtils {
...
@@ -1025,7 +1025,7 @@ public class ActionUtils {
}
}
}
}
}
}
if
(
extraKeywords
!=
null
&&
extraKeywords
!=
""
)
{
if
(
extraKeywords
!=
null
&&
!
extraKeywords
.
equals
(
""
)
)
{
conditionJson
.
put
(
"relationHead"
,
extraKeywords
);
conditionJson
.
put
(
"relationHead"
,
extraKeywords
);
}
}
...
@@ -1040,7 +1040,7 @@ public class ActionUtils {
...
@@ -1040,7 +1040,7 @@ public class ActionUtils {
}
}
}
}
}
}
if
(
extraKeywords
!=
null
&&
extraKeywords
!=
""
)
{
if
(
extraKeywords
!=
null
&&
!
extraKeywords
.
equals
(
""
)
)
{
conditionJson
.
getJSONArray
(
"repeatList"
).
getJSONObject
(
0
).
put
(
"repeatKeywords"
,
extraKeywords
);
conditionJson
.
getJSONArray
(
"repeatList"
).
getJSONObject
(
0
).
put
(
"repeatKeywords"
,
extraKeywords
);
}
}
return
true
;
return
true
;
...
...
src/main/java/com/qiwu/chatbotbackend/gameDesign/ElementConstructor.java
View file @
dab996fa
...
@@ -105,10 +105,6 @@ public class ElementConstructor {
...
@@ -105,10 +105,6 @@ public class ElementConstructor {
relationKeywords
.
put
(
conditionName
+
"_tail"
,
new
HashSet
<
String
>());
relationKeywords
.
put
(
conditionName
+
"_tail"
,
new
HashSet
<
String
>());
}
}
//visitorname和bot的替换
// premise.put("keywords", ((String)premise.get("keywords")).replace("qiwu", "#visitorname").replace(botName, "#botname"));
premise
.
put
(
"keywords"
,
replaceKeywords
((
String
)
premise
.
get
(
"keywords"
)));
for
(
String
keyword
:
((
String
)
premise
.
get
(
"keywords"
)).
split
(
"\\+"
))
{
for
(
String
keyword
:
((
String
)
premise
.
get
(
"keywords"
)).
split
(
"\\+"
))
{
if
(
keyword
.
equals
(
""
)){
if
(
keyword
.
equals
(
""
)){
...
@@ -149,9 +145,7 @@ public class ElementConstructor {
...
@@ -149,9 +145,7 @@ public class ElementConstructor {
relationKeywords
.
put
(
conditionName
+
"_tail"
,
new
HashSet
<
String
>());
relationKeywords
.
put
(
conditionName
+
"_tail"
,
new
HashSet
<
String
>());
}
}
// premise.put("keywords", ((String)premise.get("keywords")).replace("qiwu", "#visitorname").replace(botName, "#botname"));
premise
.
put
(
"keywords"
,
replaceKeywords
((
String
)
premise
.
get
(
"keywords"
)));
for
(
String
keyword
:
((
String
)
premise
.
get
(
"keywords"
)).
split
(
"\\+"
))
{
for
(
String
keyword
:
((
String
)
premise
.
get
(
"keywords"
)).
split
(
"\\+"
))
{
if
(
keyword
.
equals
(
""
)){
if
(
keyword
.
equals
(
""
)){
...
@@ -176,43 +170,6 @@ public class ElementConstructor {
...
@@ -176,43 +170,6 @@ public class ElementConstructor {
}
}
}
}
public
String
replaceKeywords
(
String
str
)
{
Boolean
startChat
=
str
.
startsWith
(
"+"
);
Map
<
String
,
String
>
keywords
=
new
HashMap
<>();
keywords
.
put
(
"qiwu"
,
"#visitorname"
);
keywords
.
put
(
"我"
,
"#visitorname"
);
keywords
.
put
(
"botName"
,
"#botname"
);
keywords
.
put
(
"你"
,
"#botname"
);
String
[]
split
=
str
.
split
(
"\\+"
);
String
_s
;
int
pos
;
String
sub1
;
String
sub2
;
for
(
int
i
=
0
;
i
<
split
.
length
;
++
i
)
{
_s
=
split
[
i
];
pos
=
_s
.
indexOf
(
":"
);
if
(
pos
==
-
1
)
{
if
(
keywords
.
get
(
_s
)
!=
null
)
{
_s
=
keywords
.
get
(
_s
);
}
}
else
{
sub1
=
_s
.
substring
(
0
,
pos
);
sub2
=
_s
.
substring
(
pos
+
1
,
_s
.
length
());
if
(
keywords
.
get
(
sub1
)
!=
null
)
{
sub1
=
keywords
.
get
(
sub1
);
}
if
(
keywords
.
get
(
sub2
)
!=
null
)
{
sub2
=
keywords
.
get
(
sub2
);
}
_s
=
sub1
+
":"
+
sub2
;
}
split
[
i
]
=
_s
;
}
str
=
String
.
join
(
"+"
,
split
);
if
(!
str
.
equals
(
""
)
&&
startChat
&&
!
str
.
startsWith
(
"+"
))
str
=
"+"
+
str
;
return
str
;
}
/**
/**
* 根据插入的数据做后处理
* 根据插入的数据做后处理
...
...
src/main/java/com/qiwu/chatbotbackend/processing/ActionMatcher.java
View file @
dab996fa
...
@@ -895,7 +895,26 @@ public class ActionMatcher {
...
@@ -895,7 +895,26 @@ public class ActionMatcher {
keyword
=
botUtil
.
getKeyword
(
historyInfoPoint
,
curInfoPoint
,
false
,
variableName
);
keyword
=
botUtil
.
getKeyword
(
historyInfoPoint
,
curInfoPoint
,
false
,
variableName
);
updateValue
=
botUtil
.
knowledgeProcess
(
variableName
,
action
.
getUpdateKnowledge
().
get
(
variableName
));
updateValue
=
botUtil
.
knowledgeProcess
(
variableName
,
action
.
getUpdateKnowledge
().
get
(
variableName
));
int
indexOf
=
variableName
.
indexOf
(
"_"
);
if
(
indexOf
!=
-
1
)
{
String
prefix
=
variableName
.
substring
(
0
,
indexOf
);
if
(
prefix
.
equals
(
"npc"
)
||
prefix
.
equals
(
"goods"
)
||
prefix
.
equals
(
"map"
)
||
prefix
.
equals
(
"place"
))
{
String
[]
split
=
variableName
.
split
(
"_"
);
if
(
split
.
length
==
4
)
{
String
_type
=
split
[
0
];
switch
(
_type
)
{
case
(
"npc"
):
keyword
=
gameEnv
.
queryNpcAttrByNpcName
(
split
[
2
],
split
[
3
]);
break
;
case
(
"goods"
):
keyword
=
gameEnv
.
queryGoodsAttrByGoodsName
(
split
[
2
],
split
[
3
]);
break
;
default
:
break
;
}
}
}
}
try
{
try
{
//做数字加法
//做数字加法
...
...
src/test/java/com/qiwu/chatbotbackend/ChatCacheTests.java
View file @
dab996fa
...
@@ -42,7 +42,7 @@ public class ChatCacheTests {
...
@@ -42,7 +42,7 @@ public class ChatCacheTests {
//先删除就数据
//先删除就数据
SqlHelper
helper
=
new
SqlHelper
();
SqlHelper
helper
=
new
SqlHelper
();
ChatCacheController
.
deleteChatCache
(
helper
,
"123456789"
);
//
ChatCacheController.deleteChatCache(helper, "123456789");
Map
<
String
,
ChatCache
>
chatCacheMap
=
null
;
Map
<
String
,
ChatCache
>
chatCacheMap
=
null
;
chatCacheMap
=
new
HashMap
<
String
,
ChatCache
>();
chatCacheMap
=
new
HashMap
<
String
,
ChatCache
>();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment