Skip to content

Commit

Permalink
repeating question should work
Browse files Browse the repository at this point in the history
  • Loading branch information
anurni committed Oct 2, 2024
1 parent 92cc9f4 commit a73af96
Showing 1 changed file with 16 additions and 47 deletions.
63 changes: 16 additions & 47 deletions src/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,21 @@ export const rules: Rules = {
private: { ...is.private, plan: [...is.private.plan.slice(1)] },
};
}
if (is.shared.qud.length > 0 && Array.isArray(is.shared.lu?.moves) && is.shared.lu.moves.length === 0) {
let noNLU;
noNLU = {
type: "noNLU",
content: null
};
newIS = {
...is,
next_moves: [ ...is.next_moves, noNLU as Move, { type: "ask", content: q } ], // states noNLU and repeats the question
};
}
else {
newIS = {
...is,
next_moves: [ ...is.next_moves, { type: "ask", content: q } ],
next_moves: [ ...is.next_moves, { type: "ask", content: q } ], //otherwise just the question
};
}
return () => newIS;
Expand Down Expand Up @@ -336,62 +347,20 @@ export const rules: Rules = {
}
},



/** for no NLU situations - rule 3.12*/
// selectIcmSemNeg: ({ is }) => {
// if(Array.isArray(is.shared.lu?.moves) && is.shared.lu.moves.length === 0) {
// const noNLU = {type: "noNLU", content: null}
// //console.log(`------------------->this is is.shared.qud ${is.shared.qud[0]}`)
// //console.log(`------------------->this is is.shared.qud ${is.shared.qud}`)
// return () => ({
// ...is,
// next_moves: [ ...is.next_moves, noNLU as Move ]
// });
// }
// },

/** for no NLU situations - rule 3.12 */
selectIcmSemNeg: ({ is }) => {
// Check if NLU moves are empty
if (Array.isArray(is.shared.lu?.moves) && is.shared.lu.moves.length === 0) {

let noNLU;
console.log(`----------------------this is the else working-------------------------------------`)
console.log(`--------------------------${is.shared.lu.moves}--------------------------------`)
console.log(`----------------${is.domain.plans[0].plan[0].content?.predicate}----------------------------------------------------------------`)
noNLU = {
type: "noNLU",
content: null
noNLU = {
type: "noNLU",
content: null
};


// Update next_moves with noNLU move
return () => ({
...is,
next_moves: [...is.next_moves, noNLU as Move]
});
}
},

//checkLastMove: ({ is }) => {
//if (is.shared.lu?.moves.)




// repeatQuestion: ({ is }) => {
// if(Array.isArray(is.shared.lu?.moves) && is.shared.lu.moves.length === 0 && is.shared.qud) {
// const noNLU = {type: "noNLU", content: null}
// const q = is.private.agenda[0].content as Question;
// console.log(`------------------->this is is.shared.qud ${is.shared.qud[0]}`)
// console.log(`------------------->this is is.shared.qud ${is.shared.qud}`)
// return () => ({
// ...is,
// next_moves: [ ...is.next_moves, noNLU { type: "ask", content: q } as Move ]
// });
// }
// }


},
};

0 comments on commit a73af96

Please sign in to comment.