recursive knowledge webs
All checks were successful
studiorailgun/trpg/pipeline/head This commit looks good
All checks were successful
studiorailgun/trpg/pipeline/head This commit looks good
This commit is contained in:
parent
482ca48927
commit
3781c73d88
@ -1,85 +0,0 @@
|
||||
{
|
||||
"selfId": 2,
|
||||
"nodes" : {
|
||||
"0" : {
|
||||
"id" : 0,
|
||||
"name" : "Bert"
|
||||
},
|
||||
"1" : {
|
||||
"id" : 1,
|
||||
"name" : "Name"
|
||||
},
|
||||
"2" : {
|
||||
"id" : 2,
|
||||
"name" : "Self"
|
||||
},
|
||||
"3" : {
|
||||
"id" : 3,
|
||||
"name" : "Person"
|
||||
},
|
||||
"4" : {
|
||||
"id" : 4,
|
||||
"name" : "Other"
|
||||
},
|
||||
"5" : {
|
||||
"id" : 5,
|
||||
"name" : "Quote"
|
||||
},
|
||||
"6" : {
|
||||
"id" : 6,
|
||||
"name" : "Conversation"
|
||||
},
|
||||
"7" : {
|
||||
"id" : 7,
|
||||
"name" : "CurrentConversation"
|
||||
},
|
||||
"8" : {
|
||||
"id" : 8,
|
||||
"name" : "Hat"
|
||||
}
|
||||
},
|
||||
"relations" : {
|
||||
"0" : {
|
||||
"id" : 0,
|
||||
"name" : "Name",
|
||||
"parent" : 0,
|
||||
"child" : 2
|
||||
},
|
||||
"1" : {
|
||||
"id" : 1,
|
||||
"name" : "InstanceOf",
|
||||
"parent" : 3,
|
||||
"child" : 2
|
||||
},
|
||||
"2" : {
|
||||
"id" : 2,
|
||||
"name" : "InstanceOf",
|
||||
"parent" : 1,
|
||||
"child" : 0
|
||||
},
|
||||
"3" : {
|
||||
"id" : 3,
|
||||
"name" : "InstanceOf",
|
||||
"parent" : 3,
|
||||
"child" : 4
|
||||
},
|
||||
"4" : {
|
||||
"id" : 4,
|
||||
"name" : "ParticipantOf",
|
||||
"parent" : 7,
|
||||
"child" : 4
|
||||
},
|
||||
"5" : {
|
||||
"id" : 5,
|
||||
"name" : "ParticipantOf",
|
||||
"parent" : 7,
|
||||
"child" : 2
|
||||
},
|
||||
"6" : {
|
||||
"id" : 6,
|
||||
"name" : "Possession",
|
||||
"parent" : 2,
|
||||
"child" : 8
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -82,5 +82,8 @@
|
||||
"parent" : 2,
|
||||
"child" : 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"children" : [
|
||||
"./data/webs/color.json"
|
||||
]
|
||||
}
|
||||
7
data/webs/test/web.json
Normal file
7
data/webs/test/web.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"tag" : "root",
|
||||
"selfId": 2,
|
||||
"children" : [
|
||||
"./data/webs/root.json"
|
||||
]
|
||||
}
|
||||
3
data/webs/test/web_no_tag.json
Normal file
3
data/webs/test/web_no_tag.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"selfId": 2
|
||||
}
|
||||
@ -11,7 +11,7 @@ public class ConvLoadingTests {
|
||||
|
||||
@Test
|
||||
public void testLoadConversation(){
|
||||
Globals.init("./data/test/webs/web.json");
|
||||
Globals.init("./data/webs/test/web.json");
|
||||
assertEquals(Globals.web.getSelf(), Globals.conversation.getSelf().getData());
|
||||
assertNotEquals(Globals.web.getSelf(), Globals.conversation.getOther().getData());
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ public class GreetingTests {
|
||||
|
||||
@Test
|
||||
public void testOtherGreeting(){
|
||||
Globals.init("./data/test/webs/web.json");
|
||||
Globals.init("./data/webs/test/web.json");
|
||||
|
||||
ConvAI.simFrame("Hello");
|
||||
|
||||
@ -23,7 +23,7 @@ public class GreetingTests {
|
||||
|
||||
@Test
|
||||
public void testGoal(){
|
||||
Globals.init("./data/test/webs/web.json");
|
||||
Globals.init("./data/webs/test/web.json");
|
||||
|
||||
ConvAI.simFrame("Hello");
|
||||
|
||||
@ -32,7 +32,7 @@ public class GreetingTests {
|
||||
|
||||
@Test
|
||||
public void testResponse(){
|
||||
Globals.init("./data/test/webs/web.json");
|
||||
Globals.init("./data/webs/test/web.json");
|
||||
|
||||
Quote response = ConvAI.simFrame("Hello");
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ public class LoadingTests {
|
||||
@Test
|
||||
public void testLoadWeb(){
|
||||
assertDoesNotThrow(() -> {
|
||||
KnowledgeWeb web = FileUtils.loadObjectFromFile(new File("./data/test/webs/web.json"), KnowledgeWeb.class);
|
||||
KnowledgeWeb web = FileUtils.loadObjectFromFile(new File("./data/webs/test/web.json"), KnowledgeWeb.class);
|
||||
web.initLinks();
|
||||
});
|
||||
}
|
||||
@ -26,7 +26,7 @@ public class LoadingTests {
|
||||
@Test
|
||||
public void testExportCSV(){
|
||||
assertDoesNotThrow(() -> {
|
||||
KnowledgeWeb web = FileUtils.loadObjectFromFile(new File("./data/test/webs/web.json"), KnowledgeWeb.class);
|
||||
KnowledgeWeb web = FileUtils.loadObjectFromFile(new File("./data/webs/test/web.json"), KnowledgeWeb.class);
|
||||
web.initLinks();
|
||||
Globals.web = web;
|
||||
CSVExport.export("test");
|
||||
@ -36,7 +36,7 @@ public class LoadingTests {
|
||||
@Test
|
||||
public void testNoTag(){
|
||||
assertThrows(UnsupportedOperationException.class, () -> {
|
||||
KnowledgeWeb.load("./data/test/webs/web_no_tag.json");
|
||||
KnowledgeWeb.load("./data/webs/test/web_no_tag.json");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ public class QueryTests {
|
||||
|
||||
@Test
|
||||
public void testOtherGreeting(){
|
||||
Globals.init("./data/test/webs/web.json");
|
||||
Globals.init("./data/webs/test/web.json");
|
||||
|
||||
Quote response = ConvAI.simFrame("What color is your hat?");
|
||||
|
||||
|
||||
77
web.json
77
web.json
@ -1,76 +1,7 @@
|
||||
{
|
||||
"tag" : "root",
|
||||
"tag" : "top",
|
||||
"selfId": 2,
|
||||
"nodes" : {
|
||||
"0" : {
|
||||
"id" : 0,
|
||||
"name" : "Bert"
|
||||
},
|
||||
"1" : {
|
||||
"id" : 1,
|
||||
"name" : "Name"
|
||||
},
|
||||
"2" : {
|
||||
"id" : 2,
|
||||
"name" : "Self"
|
||||
},
|
||||
"3" : {
|
||||
"id" : 3,
|
||||
"name" : "Person"
|
||||
},
|
||||
"4" : {
|
||||
"id" : 4,
|
||||
"name" : "Other"
|
||||
},
|
||||
"5" : {
|
||||
"id" : 5,
|
||||
"name" : "Quote"
|
||||
},
|
||||
"6" : {
|
||||
"id" : 6,
|
||||
"name" : "Conversation"
|
||||
},
|
||||
"7" : {
|
||||
"id" : 7,
|
||||
"name" : "CurrentConversation"
|
||||
}
|
||||
},
|
||||
"relations" : {
|
||||
"0" : {
|
||||
"id" : 0,
|
||||
"name" : "Name",
|
||||
"parent" : 0,
|
||||
"child" : 2
|
||||
},
|
||||
"1" : {
|
||||
"id" : 1,
|
||||
"name" : "InstanceOf",
|
||||
"parent" : 3,
|
||||
"child" : 2
|
||||
},
|
||||
"2" : {
|
||||
"id" : 2,
|
||||
"name" : "InstanceOf",
|
||||
"parent" : 1,
|
||||
"child" : 0
|
||||
},
|
||||
"3" : {
|
||||
"id" : 3,
|
||||
"name" : "InstanceOf",
|
||||
"parent" : 3,
|
||||
"child" : 4
|
||||
},
|
||||
"4" : {
|
||||
"id" : 4,
|
||||
"name" : "ParticipantOf",
|
||||
"parent" : 7,
|
||||
"child" : 4
|
||||
},
|
||||
"5" : {
|
||||
"id" : 5,
|
||||
"name" : "ParticipantOf",
|
||||
"parent" : 7,
|
||||
"child" : 2
|
||||
}
|
||||
}
|
||||
"children" : [
|
||||
"./data/webs/root.json"
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user