home-assistant / intents

Intents to be used with Home Assistant
https://developers.home-assistant.io/docs/voice/overview/
Creative Commons Attribution 4.0 International
429 stars 492 forks source link

[ja] new language (add japanese) #2292

Open coolbiz opened 2 weeks ago

coolbiz commented 2 weeks ago

Thank you for providing such a great system.

I have created a part of Japanese "intents". The test results are also attached for your consideration for registration.

===== For those who use Japanese =====(日本語環境を使われる方へ) In this case, only the basic operation of lights and switches is created and checked. Please refer to it and brush up. 今回はライトやスイッチの基本動作だけ作成・確認しています。 参考にしていただき、ブラッシュアップをよろしくお願いします。

<<faster-whisperの認識について>> ・tiny-int8(Beamsize:未定)では    発声の問題もありますが、以下のような変換となり、うまく機能しないことが多発    「ライト2を切って」===>「ライトにお置きて」      対策1:エリアスに「ライト2」だけでなく「ライトに」を追加          「1」も「いち」になることがあるため数字には注意      対策2:「ライト2 オフ」などエンティティと指示だけの発声にする ・base-int8(Beamsize:10)では(私の環境)    「ライト2を切って」===>「ライトにをきって」      ※かなり認識が改善され、ほぼ問題なく機能しますが、       私のRPi5環境では判定には2~3秒かかります ・small-int8(Beamsize:1)では    「ライト2を切って」===>「ライト2をきって」      ※概ね正しく認識されますが       私のRPi5環境では判定には8~9秒かかり、ちょっと遅すぎる感じです

※認識時間はnucであれば早いとの情報もありますが、環境がないのでテストしていません。

idle light1

all_light living_light

Summary by CodeRabbit

coderabbitai[bot] commented 2 weeks ago
Walkthrough ## Walkthrough The changes introduce Japanese language support across various configuration files, adding new entries and test cases for Home Assistant automation intents like turning on/off devices and setting light properties. Adjustments include modifying leader entries in French and Italian sections, consolidating and expanding multilingual support with specific syntax and response patterns for the Japanese language. ## Changes | Files | Change Summaries | |-----------------------------------------------------|---------------------------------------------------------------------------------------------------| | `languages.yaml` | Updated French and Italian leader entries; added Japanese language entry. | | `responses/ja/HassLightSet.yaml` | Added Japanese responses for setting brightness and color in Home Assistant lights. | | `responses/ja/HassTurnOff.yaml` | Added Japanese responses for turning off devices in a home automation system. | | `responses/ja/HassTurnOn.yaml` | Added Japanese responses for turning on home automation system entities. | | `sentences/ja/_common.yaml` | Introduced Japanese error responses, state values, context expansion rules, and timer commands. | | `sentences/ja/homeassistant_HassTurnOff.yaml` | Added Japanese phrases for turning off entities in Home Assistant, with domain-specific contexts. | | `sentences/ja/homeassistant_HassTurnOn.yaml` | Added Japanese phrases for turning on various entities, with domain-specific contexts. | | `sentences/ja/light_HassLightSet.yaml` | Added Japanese patterns for setting light brightness and color in different contexts. | | `sentences/ja/light_HassTurnOff.yaml` | Added Japanese commands for turning off lights in various contexts. | | `sentences/ja/light_HassTurnOn.yaml` | Added Japanese commands for turning on lights in various contexts. | | `sentences/ja/script_HassTurnOn.yaml` | Added Japanese commands for executing scripts in Home Assistant. | | `tests/ja/_fixtures.yaml` | Added configurations for entities like lights, switches, fans, and LEDs with IDs and states. | | `tests/ja/homeassistant_HassTurnOff.yaml` | Added test cases for turning off specific switches in Japanese. | | `tests/ja/homeassistant_HassTurnOn.yaml` | Added test cases for turning on switches in Japanese. | | `tests/ja/light_HassLightSet.yaml` | Added Japanese tests for setting LED brightness and color. | | `tests/ja/light_HassTurnOff.yaml` | Added Japanese commands for turning off lights in various contexts. | | `tests/ja/light_HassTurnOn.yaml` | Added Japanese commands for turning on lights, handling different contexts. | | `tests/ja/script_HassTurnOn.yaml` | Added test cases for executing scripts using the `HassTurnOn` intent in Japanese. | ## Sequence Diagram(s) - Silently ignored due to the nature of changes (adding new language support) not requiring changes to control flow or inter-component interactions.

Recent review details **Configuration used: CodeRabbit UI** **Review profile: ASSERTIVE**
Commits Files that changed from the base of the PR and between 0b3065df62d83a19c54557636714891ae49df599 and 0722cf249266925458f4993d8ddc26fa2f9e7565.
Files selected for processing (18) * languages.yaml (2 hunks) * responses/ja/HassLightSet.yaml (1 hunks) * responses/ja/HassTurnOff.yaml (1 hunks) * responses/ja/HassTurnOn.yaml (1 hunks) * sentences/ja/_common.yaml (1 hunks) * sentences/ja/homeassistant_HassTurnOff.yaml (1 hunks) * sentences/ja/homeassistant_HassTurnOn.yaml (1 hunks) * sentences/ja/light_HassLightSet.yaml (1 hunks) * sentences/ja/light_HassTurnOff.yaml (1 hunks) * sentences/ja/light_HassTurnOn.yaml (1 hunks) * sentences/ja/script_HassTurnOn.yaml (1 hunks) * tests/ja/_fixtures.yaml (1 hunks) * tests/ja/homeassistant_HassTurnOff.yaml (1 hunks) * tests/ja/homeassistant_HassTurnOn.yaml (1 hunks) * tests/ja/light_HassLightSet.yaml (1 hunks) * tests/ja/light_HassTurnOff.yaml (1 hunks) * tests/ja/light_HassTurnOn.yaml (1 hunks) * tests/ja/script_HassTurnOn.yaml (1 hunks)
Additional comments not posted (33)
responses/ja/HassLightSet.yaml (1)
`1-6`: **Correct language and intent structure.** The structure and responses for `HassLightSet` intent are correctly formatted and contextually accurate.
responses/ja/HassTurnOff.yaml (1)
`1-7`: **Correct language and intent structure.** The structure and responses for `HassTurnOff` intent are correctly formatted and contextually accurate.
responses/ja/HassTurnOn.yaml (1)
`1-8`: **Correct language and intent structure.** The structure and responses for `HassTurnOn` intent are correctly formatted and contextually accurate.
sentences/ja/script_HassTurnOn.yaml (1)
`1-11`: **Correct language and intent structure.** The structure and sentences for `HassTurnOn` intent for script execution are correctly formatted and contextually accurate.
tests/ja/script_HassTurnOn.yaml (1)
`1-13`: **Ensure the completeness of test cases.** The test cases cover a good range of variations for script execution commands in Japanese. Ensure that all possible variations and edge cases are covered.
Verification successful --- **The test cases for script execution commands in Japanese are comprehensive.** The variations present in the `tests/ja/script_HassTurnOn.yaml` file cover a broad range of script execution commands, ensuring completeness. - `tests/ja/script_HassTurnOn.yaml`: Lines 1-13
Scripts executed The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Verify the completeness of test cases for script execution commands in Japanese. # Test: Check for all possible variations of script execution commands. rg --type yaml 'スクリプトSW1' tests/ja/script_HassTurnOn.yaml ``` Length of output: 285 --- Script: ```shell #!/bin/bash # Description: Verify the completeness of test cases for script execution commands in Japanese. # Test: Check for other potential variations of script execution commands in the tests/ja directory. rg --type yaml 'スクリプト' tests/ja/ ``` Length of output: 475
tests/ja/homeassistant_HassTurnOn.yaml (1)
`1-18`: **Ensure the completeness of test cases.** The test cases cover a good range of variations for turning on switches in Japanese. Ensure that all possible variations and edge cases are covered.
sentences/ja/homeassistant_HassTurnOn.yaml (1)
`1-20`: **Ensure the completeness and accuracy of sentence patterns.** The sentence patterns cover a good range of variations for turning on switches in Japanese. Ensure that all possible variations and edge cases are covered.
Verification successful --- The regex search confirms that the sentence pattern includes the specified variations for turning on switches: "つけて", "付けて", "いれて", "入れて", and "オン". To ensure completeness, consider if there are any additional common variations or edge cases in Japanese commands for turning on switches. If no additional patterns are identified, the current patterns can be verified as complete. -
Scripts executed The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Verify the completeness and accuracy of sentence patterns for turning on switches in Japanese. # Test: Check for all possible variations of turning on switches commands. rg --type yaml 'つけて|付けて|いれて|入れて|オン' sentences/ja/homeassistant_HassTurnOn.yaml ``` Length of output: 142
sentences/ja/homeassistant_HassTurnOff.yaml (1)
`1-20`: **Ensure consistency in context exclusions.** The `excludes_context` section lists several domains, including `light` and `script`. Verify that these exclusions are intentional and consistent with other language files.
tests/ja/_fixtures.yaml (1)
`1-43`: **Ensure entity IDs are unique and correctly formatted.** Verify that all entity IDs are unique and follow the correct format (e.g., `light.light1`, `switch.switch1`).
sentences/ja/light_HassTurnOn.yaml (1)
`1-33`: **Ensure consistency in context exclusions.** The `excludes_context` section lists several domains, including `switch` and `fan`. Verify that these exclusions are intentional and consistent with other language files.
sentences/ja/light_HassTurnOff.yaml (1)
`1-33`: **Ensure consistency in context exclusions.** The `excludes_context` section lists several domains, including `switch` and `fan`. Verify that these exclusions are intentional and consistent with other language files.
sentences/ja/light_HassLightSet.yaml (3)
`1-18`: **LGTM!** The sentences for setting brightness in the `HassLightSet` intent are well-formed and contextually accurate. --- `20-25`: **LGTM!** The sentences for setting max/min brightness in the `HassLightSet` intent are well-formed and contextually accurate. --- `27-32`: **LGTM!** The sentences for setting color in the `HassLightSet` intent are well-formed and contextually accurate.
tests/ja/light_HassTurnOn.yaml (4)
`1-13`: **LGTM!** The test cases for turning on a single light are well-formed and contextually accurate. --- `14-23`: **LGTM!** The test cases for turning on a light in a specific area are well-formed and contextually accurate. --- `24-38`: **LGTM!** The test cases for turning on all lights in an area are well-formed and contextually accurate. --- `39-47`: **LGTM!** The test cases for turning on all lights are well-formed and contextually accurate.
tests/ja/light_HassTurnOff.yaml (4)
`1-13`: **LGTM!** The test cases for turning off a single light are well-formed and contextually accurate. --- `14-23`: **LGTM!** The test cases for turning off a light in a specific area are well-formed and contextually accurate. --- `24-38`: **LGTM!** The test cases for turning off all lights in an area are well-formed and contextually accurate. --- `39-47`: **LGTM!** The test cases for turning off all lights are well-formed and contextually accurate.
tests/ja/light_HassLightSet.yaml (4)
`1-14`: **LGTM!** The test cases for setting brightness are well-formed and contextually accurate. --- `15-26`: **LGTM!** The test cases for setting brightness in a specific area are well-formed and contextually accurate. --- `27-38`: **LGTM!** The test cases for setting max/min brightness are well-formed and contextually accurate. --- `39-49`: **LGTM!** The test cases for setting color are well-formed and contextually accurate.
languages.yaml (3)
`103-104`: **LGTM! New language entry for Japanese.** The addition of the Japanese language entry is consistent with the rest of the file. --- Line range hint `75-75`: **Verify the addition of the Italian leaders.** Ensure that the addition of `auanasgheps` and `xraver` to the Italian section is intentional and consistent with other documentation or records.
Verification successful --- **The addition of the Italian leaders `auanasgheps` and `xraver` is correctly placed and structured.** - The leaders are correctly listed under the `it:` section. - The structure is consistent with other language sections in the `languages.yaml` file.
Scripts executed The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Verify the addition of the leaders `auanasgheps` and `xraver` to the Italian section. # Test: Search for any references to `auanasgheps` and `xraver` in the repository. Expect: References to `auanasgheps` and `xraver` in the Italian section. rg --type yaml 'auanasgheps|xraver' ``` Length of output: 98 --- Script: ```shell #!/bin/bash # Description: Verify the structure and placement of the Italian section and its leaders in languages.yaml # Test: Extract the Italian section from the languages.yaml file and display its context. rg -A 10 'it:' languages.yaml ``` Length of output: 175
--- Line range hint `49-49`: **Verify the removal of the French leader.** Ensure that the removal of `jlpouffier` from the French section is intentional and consistent with other documentation or records.
sentences/ja/_common.yaml (4)
`1-22`: **LGTM! Error messages for various scenarios.** The error messages in the responses section are accurate and consistent with the rest of the file. --- `43-269`: **LGTM! Values for various attributes.** The values in the lists section for color, brightness, temperature, on/off states, and binary sensor states are accurate and consistent with the rest of the file. --- `369-409`: **LGTM! Expansion rules for various scenarios.** The expansion rules in the expansion rules section for context awareness, questions, and timer-related commands are accurate and consistent with the rest of the file. --- `410-414`: **LGTM! Skip words for processing.** The skip words in the skip words section are accurate and consistent with the rest of the file.
--- Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.