var jsonObj = {
"fathers": [{
"age": 44,
"name": "James Martin",
"daughters": [{
"age": 24,
"name": "Michelle",
"husband": {
"age": 30,
"name": "Matthew"
}
}, {
"age": 30,
"name": "Angela",
"husband": {
"age": 23,
"name": "William"
}
}]
}, {
"age": 47,
"name": "David Thompson",
"daughters": [{
"age": 20,
"name": "Amy",
"husband": {
"age": 26,
"name": "Edward"
}
}, {
"age": 20,
"name": "Dorothy",
"husband": {
"age": 23,
"name": "Timothy"
}
}]
}, {
"age": 56,
"name": "Thomas Young",
"daughters": [{
"age": 22,
"name": "Sharon",
"husband": {
"age": 23,
"name": "Jason"
}
}, {
"age": 22,
"name": "Carol",
"husband": {
"age": 23,
"name": "William"
}
}, {
"age": 20,
"name": "Brenda",
"husband": {
"age": 30,
"name": "Timothy"
}
}]
}, {
"age": 53,
"name": "Jason Martinez",
"daughters": [{
"age": 19,
"name": "Jessica",
"husband": {
"age": 24,
"name": "Daniel"
}
}]
}, {
"age": 51,
"name": "Thomas Gonzalez",
"daughters": [{
"age": 23,
"name": "Brenda",
"husband": {
"age": 30,
"name": "George"
}
}, {
"age": 30,
"name": "Dorothy",
"husband": {
"age": 23,
"name": "Brian"
}
}]
}, {
"age": 41,
"name": "James Lee",
"daughters": [{
"age": 20,
"name": "Sarah",
"husband": {
"age": 24,
"name": "Frank"
}
}, {
"age": 21,
"name": "Carol",
"husband": {
"age": 28,
"name": "Larry"
}
}]
}, {
"age": 58,
"name": "Kenneth Brown",
"daughters": [{
"age": 23,
"name": "Ruth",
"husband": {
"age": 24,
"name": "Brian"
}
}, {
"age": 18,
"name": "Lisa",
"husband": {
"age": 24,
"name": "Scott"
}
}, {
"age": 27,
"name": "Sandra",
"husband": {
"age": 31,
"name": "Charles"
}
}]
}, {
"age": 50,
"name": "Thomas Lee",
"daughters": [{
"age": 27,
"name": "Patricia",
"husband": {
"age": 30,
"name": "Scott"
}
}, {
"age": 21,
"name": "Jennifer",
"husband": {
"age": 23,
"name": "George"
}
}]
}, {
"age": 50,
"name": "Robert Anderson",
"daughters": [{
"age": 24,
"name": "Angela",
"husband": {
"age": 23,
"name": "James"
}
}]
}]
};
[
{
componentA: value1,
componentB: value2,
componentC: value3
},
{
componentA: value4,
componentD: value5
}
]
[
{
}
]
[
{
race: "human"
}
]
[
{
race: "human",
gender: "female"
}
]
[
{
race: "human",
gender: "female",
occupation: "entrepreneur"
}
]
[
{
race: "human",
gender: "female",
occupation: "entrepreneur"
motherOf: ["Cathy", "Jack"]
}
]
{
"fathers": [
"Alex",
"Brian",
"Carl",
"Alex"
],
"mothers": [
"Diane",
"Elizabeth",
"Florence",
"Diane"
],
"married": [
2,
1,
0,
3
]
}
$DB = array (
'fathers' =>
array (
0 => 'Alex',
1 => 'Brian',
2 => 'Carl',
3 => 'Alex',
),
'mothers' =>
array (
0 => 'Diane',
1 => 'Elizabeth',
2 => 'Florence',
3 => 'Diane',
),
'married' =>
array (
0 => 2,
1 => 1,
2 => 0,
3 => 3,
),
);
This reply is intended to demonstrate a name collision for "Alex" and "Diane" in JSON, and implied, unique keys when converted to PHP. By "implied" I mean invisible but still present. By "unique" I mean automatic numbering.Yes, there's an index anyway, you're right. But you can choose to ignore it, and pretend there's no index.
Funnily enough. That's how I code Mitsuku to be able to answer all those silly "Is a train faster than a snail?" or "Can you lift a church?" type questions. I have a database of around 3000 common objects with attributes for each and have written AIML so Mitsuku can manipulate them to find the correct answers.It seems that what makes Mitsuku efficient is the enormous volume of data that's been (manually?) produced, and clever architectural patterns like the one you described. Did you have any consistency-related issue, or trouble handling such a big brain (shadows, ...etc.)?
looks like your going good.My theory is that the dev who coded how to pick knowledge should probably code how to use this knowledge. Learning is an important part of any AI project, but I believe there are other ways than low-level, "pixel style" learning.
so if the robot has picked up some knowledge, even if it was rubbish a bit, how is it going to use its rubbish?
foreach($DB['married'] as $father=>$mother)
{
echo $DB['fathers'][$father]. " married ".$DB['mothers'][$mother]."\n";
}
Alex married Florence
Brian married Elizabeth
Carl married Diane
Alex married Diane
Funnily enough. That's how I code Mitsuku to be able to answer all those silly "Is a train faster than a snail?" or "Can you lift a church?" type questions. I have a database of around 3000 common objects with attributes for each and have written AIML so Mitsuku can manipulate them to find the correct answers.
Here is part of my entry for the word "tree".
(https://aidreams.co.uk/forum/proxy.php?request=http%3A%2F%2Fwww.square-bear.co.uk%2Fobject.png&hash=ef7b5ac97c8fa34a383401e1f9fb7911dbb9ac5a)
The beauty of this is that the chatbot can work things out without having a direct attribute to answer it. So, I don't have a "is edible" attribute but Mitsuku can work out that a tree is "madefrom" wood and you can't eat wood, so you can't eat a tree. It saves hours of coding answers to random nonsense questions.
$tree = new StdClass();
$tree->{"named"} = 'tree';
$tree->{"made of"} = 'wood';
$tree->{"has"} = 'leaves';
"But you can choose to ignore it, and pretend there's no index.", said Zero.
Yes, but not eliminate it, except in cases very small in size, most programmers agree.
No index makes it non-relational. An index makes it relational (demonstrated below).
Here is the second part of my PHP code sample:Codeforeach($DB['married'] as $father=>$mother)
{
echo $DB['fathers'][$father]. " married ".$DB['mothers'][$mother]."\n";
}
And, here is the program output:QuoteAlex married Florence
Brian married Elizabeth
Carl married Diane
Alex married Diane
}
whatHappened: "had a car accident"
who: {
firstname: "John",
lastname: "Smith",
howDoIKnowHim: "met at wedding"
},
when: "last week"
}
[
{
"what": "Salary",
"who": [
{
"first": "John",
"last": "Doe",
"paid": "1500.00"
}
],
"when": "Friday"
},
{
"what": "Salary",
"who": [
{
"first": "John",
"last": "Doe",
"paid": "1500.00"
}
],
"when": "Friday"
}
]
array (
0 =>
array(
'what' => 'Salary',
'who' =>
array (
0 =>
array(
'first' => 'John',
'last' => 'Doe',
'paid' => '1500.00',
),
),
'when' => 'Friday',
),
1 =>
array(
'what' => 'Salary',
'who' =>
array (
0 =>
array(
'first' => 'John',
'last' => 'Doe',
'paid' => '1500.00',
),
),
'when' => 'Friday',
),
)
No lag at all. Mitsuku usually processes and responds to any input under half a second even when dealing with hundreds of users at once. She has to search and process over 300,000 categories and the responses are extremely quick.