From 2669872d385ff89a052e0c34f63eae704d5ee95e Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Fri, 6 Dec 2024 11:50:54 -0800 Subject: [PATCH] [en] Enable the use of possessives for some nouns Rather than only accepting `the`, many sentences should also accept a possessive like `my`. This doesn't make sense for all instances of ``, so I'll make another refactor commit after this one --- sentences/en/_common.yaml | 29 ++++++++++--------- .../en/homeassistant_HassGetCurrentDate.yaml | 4 +-- .../en/homeassistant_HassGetCurrentTime.yaml | 2 +- tests/en/homeassistant_HassGetState.yaml | 2 ++ tests/en/homeassistant_HassTurnOn.yaml | 1 + 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/sentences/en/_common.yaml b/sentences/en/_common.yaml index a3b54ca075..b4d1f517dc 100644 --- a/sentences/en/_common.yaml +++ b/sentences/en/_common.yaml @@ -361,22 +361,23 @@ lists: wildcard: true expansion_rules: - name: "[the ]{name}" - area: "[the ]{area}" - floor: "[the ]{floor}[ floor]" + the: "(the|my|our)" + name: "[] {name}" + area: "[] {area}" + floor: "[] {floor}[ floor]" area_floor: "(|)" in_area_floor: "[ ]" - what_is: "(what's|whats|what is|tell me)[ the]" - lockable: "[(the|my) ](lock|door|window|gate|garage door|shutter)[s]" + what_is: "(what's|whats|what is|tell me) []" + lockable: "[] (lock|door|window|gate|garage door|shutter)[s]" where_is: "(where's|wheres|where is)" - which: "(which|what)[ of the]" - is: "(is|are)[ (there|the)]" + which: "(which|what) [of ]" + is: "(is|are) [(there|)]" are: "" - any: "(any|some)[ of the]" - are_any: "[ ]" - how_many: "how many[ of the]" + any: "(any|some) [of ]" + are_any: "[] " + how_many: "how many [of ]" brightness: "{brightness}[[ ]%| percent]" - light: "[the ](light|lights|lighting|lamp|lamps)" + light: "[] (light|lights|lighting|lamp|lamps)" turn: "(turn|switch|change|bring)" temp: "(temp|temperature)" temperature: "{temperature}[([ ]°[ ][{temperature_unit}])|( degrees[ {temperature_unit}])]" @@ -392,11 +393,11 @@ expansion_rules: clean: (vacuum|clean) # Context awareness expansion rules - all: "(all[[ of] the]|every[ single]|each[ and every])" + all: "(all[[ of] ]|every[ single]|each[ and every])" are_all: "[ ]" home: "(home|house|appartment|flat)" - everywhere: "(everywhere|all over|[] the [(entire|whole)] |[] (room|area|floor)[s])" - here: "([in] here|[in] (this|the) (room|area|space))" + everywhere: "(everywhere|all over|[] [(entire|whole)] |[] (room|area|floor)[s])" + here: "([in] here|[in] (this|) (room|area|space))" # Questions what_is_the_class_of_name: "( the (of|in|from|(indicated|measured) by) [in ]| ['s] [in ]| ['s] )" diff --git a/sentences/en/homeassistant_HassGetCurrentDate.yaml b/sentences/en/homeassistant_HassGetCurrentDate.yaml index 5edf2ea202..00f224d8f0 100644 --- a/sentences/en/homeassistant_HassGetCurrentDate.yaml +++ b/sentences/en/homeassistant_HassGetCurrentDate.yaml @@ -3,5 +3,5 @@ intents: HassGetCurrentDate: data: - sentences: - - "(|tell me) (todays|today's|the current) date" - - "(|tell me) the date [today]" + - " (todays|today's|the current) date" + - " the date [today]" diff --git a/sentences/en/homeassistant_HassGetCurrentTime.yaml b/sentences/en/homeassistant_HassGetCurrentTime.yaml index 04c534a70c..2e5744739e 100644 --- a/sentences/en/homeassistant_HassGetCurrentTime.yaml +++ b/sentences/en/homeassistant_HassGetCurrentTime.yaml @@ -3,5 +3,5 @@ intents: HassGetCurrentTime: data: - sentences: - - "(|tell me) the [current] time" + - " the [current] time" - "what time is it [[right] now]" diff --git a/tests/en/homeassistant_HassGetState.yaml b/tests/en/homeassistant_HassGetState.yaml index b0d46b16ed..e476e2c6c6 100644 --- a/tests/en/homeassistant_HassGetState.yaml +++ b/tests/en/homeassistant_HassGetState.yaml @@ -122,6 +122,7 @@ tests: - sentences: - "how many lights are on in the kitchen?" + - "how many lights are on in my kitchen?" intent: name: HassGetState slots: @@ -132,6 +133,7 @@ tests: - sentences: - "how many lights are on at the first floor?" + - "how many lights are on at my first floor?" intent: name: HassGetState slots: diff --git a/tests/en/homeassistant_HassTurnOn.yaml b/tests/en/homeassistant_HassTurnOn.yaml index 66e9758526..5e868ccff5 100644 --- a/tests/en/homeassistant_HassTurnOn.yaml +++ b/tests/en/homeassistant_HassTurnOn.yaml @@ -7,6 +7,7 @@ tests: - "turn the ceiling fan on" - "ceiling fan on" - "activate ceiling fan" + - "turn my ceiling fan on" intent: name: HassTurnOn slots: