Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ja] new language (add japanese) #2292

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

coolbiz
Copy link

@coolbiz coolbiz commented Jul 9, 2024

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

  • New Features

    • Introduced Japanese language support across various Home Assistant intents, including turning on/off devices, setting light brightness and color, and executing scripts.
    • Added specific test cases and configurations for Japanese language support in home automation responses.
    • Added a new language entry for Japanese (日本語) in the configuration.
  • Enhancements

    • Updated leadership entries for French and Italian sections, including the removal and addition of leaders.

Copy link

coderabbitai bot commented Jul 9, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes introduce a new language entry for Japanese (日本語) in the languages.yaml file. This addition includes the nativeName field set to "日本語" and a leaders field containing a single entry: "coolbiz". No modifications to existing language entries or their structures are present in the diff.

Changes

Files Change Summaries
languages.yaml Added Japanese language entry with nativeName: 日本語 and leaders: - coolbiz.

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: CHILL

📥 Commits

Files that changed from the base of the PR and between 0722cf2 and c8f55ac.

📒 Files selected for processing (1)
  • languages.yaml (1 hunks)
🔇 Additional comments (1)
languages.yaml (1)

103-107: LGTM! Japanese language entry is properly configured.

The entry follows the established pattern with correct structure, indentation, and alphabetical positioning. The native name is correctly specified in Japanese characters.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Comment on lines +1 to +20
language: ja
intents:
HassTurnOff:
data:
- sentences:
- "[<area>の]<name>[を|お](けして|消して|きって|切って|オフ[に][して])"
excludes_context:
domain:
- binary_sensor
- cover
- lock
- scene
- sensor
- valve
# another intent
- light
- script
- fan
slots:
domain: switch
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding comments for clarity.

Adding comments to explain the purpose of each section (e.g., excludes_context, slots) can improve maintainability and readability.

Comment on lines +1 to +43
language: ja
areas:
- name: "リビング"
id: "living"

- name: "寝室"
id: "bedroom"

entities:
- name: "ライト1"
id: light.light1
area: "living"
state: "on"

- name: "ライト2"
id: light.light2
area: "living"
state: "on"

- name: "ライト3"
id: light.light3
area: "bedroom"
state: "on"

- name: "スイッチ1"
id: switch.switch1
area: "living"

- name: "スイッチ2"
id: switch.switch2
area: "bedroom"

- name: "スクリプトSW1"
id: script.script_sw1
area: "living"

- name: "ファン1"
id: fan.fan1
area: "living"

- name: "LED"
id: light.led
area: "bedroom"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding comments for clarity.

Adding comments to explain the purpose of each section (e.g., areas, entities) can improve maintainability and readability.

Comment on lines +1 to +33
language: ja
intents:
HassTurnOn:
data:
- sentences:
- "[<area>の]<name>[の<light>][を|お](つけて|付けて|いれて|入れて|オン[に][して])"
excludes_context:
domain:
- switch
- fan
requires_context:
domain:
- light
slots:
domain: light

# Turn on all lights in a area
- sentences:
- "<area>の[<all>の]<light>[を|お](つけて|付けて|いれて|入れて|オン[に][して])"
excludes_context:
domain:
- switch
- fan
slots:
domain: "light"
response: "lights_area"

# Turn on all lights in the home
- sentences:
- "<all><light>[を|お](つけて|付けて|いれて|入れて|オン[に][して])"
slots:
domain: "light"
response: "light_all"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding comments for clarity.

Adding comments to explain the purpose of each section (e.g., excludes_context, slots, response) can improve maintainability and readability.

Comment on lines +1 to +33
language: ja
intents:
HassTurnOff:
data:
- sentences:
- "[<area>の]<name>[の<light>][を|お](けして|消して|きって|切って|オフ[に][して])"
excludes_context:
domain:
- switch
- fan
requires_context:
domain:
- light
slots:
domain: light

# Turn off all lights in a area
- sentences:
- "<area>の[<all>の]<light>[を|お](けして|消して|きって|切って|オフ[に][して])"
excludes_context:
domain:
- switch
- fan
slots:
domain: light
response: "lights_area"

# Turn off all lights in the home
- sentences:
- "<all><light>[を|お](けして|消して|きって|切って|オフ[に][して])"
slots:
domain: "light"
response: "light_all"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding comments for clarity.

Adding comments to explain the purpose of each section (e.g., excludes_context, slots, response) can improve maintainability and readability.

Comment on lines +1 to +18
language: ja
tests:
- sentences:
- "リビングのスイッチ1オフ"
intent:
name: HassTurnOff
slots:
domain: switch
name: "スイッチ1"
area: "リビング"

- sentences:
- "スイッチ2オフして"
intent:
name: HassTurnOff
slots:
domain: switch
name: "スイッチ2"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Ensure completeness of test cases for switches

The test cases for turning off switches in tests/ja/homeassistant_HassTurnOff.yaml are limited to two variations. Consider adding more variations and edge cases similar to the comprehensive test cases for lights in tests/ja/light_HassTurnOff.yaml.

  • Add more variations for turning off switches, including different ways to phrase the command.
  • Include edge cases such as turning off all switches in an area.
Analysis chain

Ensure the completeness of test cases.

The test cases cover a good range of variations for turning off switches in Japanese. Ensure that all possible variations and edge cases are covered.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the completeness of test cases for turning off switches in Japanese.

# Test: Check for all possible variations of turning off switches commands.
rg --type yaml 'スイッチ' tests/ja/homeassistant_HassTurnOff.yaml

Length of output: 195


Script:

#!/bin/bash
# Description: Verify the completeness of test cases for turning off switches in Japanese.

# Test: Check for all instances of the "HassTurnOff" intent in the entire tests/ja directory.
rg --type yaml 'HassTurnOff' tests/ja

Length of output: 389


Script:

#!/bin/bash
# Description: Display the content of tests/ja/light_HassTurnOff.yaml to analyze additional test cases for the "HassTurnOff" intent.

cat tests/ja/light_HassTurnOff.yaml

Length of output: 894

languages.yaml Outdated Show resolved Hide resolved
Copy link
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you! Welcome!

Can you reach out to Missy on Discord to be added to the language leaders channel

@synesthesiam synesthesiam self-assigned this Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants