diff --git a/src/is.ts b/src/is.ts index 062f55f..c98de1f 100644 --- a/src/is.ts +++ b/src/is.ts @@ -2,11 +2,11 @@ import InformationState from "./types"; import { objectsEqual} from "./utils"; export const initialIS = (): InformationState => { - const predicates = { + const predicates = { // Mapping from predicate to sort favorite_food: "food", booking_course: "course", }; - const individuals = { + const individuals = { // Mapping from individual to sort pizza: "food", LT2319: "course", }; diff --git a/src/nlug.ts b/src/nlug.ts index 86d6ddf..8819241 100644 --- a/src/nlug.ts +++ b/src/nlug.ts @@ -7,19 +7,23 @@ interface NLUMapping { type NLGMapping = [Move, string][]; const nluMapping: NLUMapping = { - "Where is the lecture?": { + "where is the lecture?": { type: "ask", content: (x) => ({"predicate": "booking_room", "argument": x}), }, - "What's your favorite food?": { + "what's your favorite food?": { type: "ask", content: (x) => ({"predicate": "favorite_food", "argument": x}), }, - "Pizza": { + "pizza": { type: "answer", content: "pizza", }, - "Dialogue Systems 2": { + "dialogue systems 2": { + type: "answer", + content: "LT2319", + }, + "dialogue systems": { type: "answer", content: "LT2319", }, @@ -63,7 +67,7 @@ export function nlg(move: Move | null): string { */ export function nlu(utterance: string): Move { return ( - nluMapping[utterance] || { + nluMapping[utterance.toLowerCase()] || { type: "unknown", content: "", } diff --git a/src/rules.ts b/src/rules.ts index e4df9fa..40fa4c5 100644 --- a/src/rules.ts +++ b/src/rules.ts @@ -137,7 +137,6 @@ export const rules: Rules = { const a = is.shared.lu!.move.content; if (topQUD && is.shared.lu!.move.type === "answer") { if (is.domain.relevant(a, topQUD)) { - // TODO (?) should combined proposition be added to domain? const newIS = { ...is, shared: {