Skip to content

docs: split fine-grained phoneme guides#77

Merged
Kilerd merged 4 commits into
mainfrom
codex/add-japanese-phoneme-docs
May 7, 2026
Merged

docs: split fine-grained phoneme guides#77
Kilerd merged 4 commits into
mainfrom
codex/add-japanese-phoneme-docs

Conversation

@Kilerd
Copy link
Copy Markdown
Contributor

@Kilerd Kilerd commented May 7, 2026

Summary

  • keep Fine-grained Control as the overview page with phoneme-control entry points and paralanguage guidance
  • add dedicated English, Chinese, and Japanese phoneme-control pages
  • document English CMU Arpabet, Chinese tone-number pinyin, and Japanese OpenJTalk romaji with pitch accent markers
  • add the new language pages to docs navigation and llms.txt

Verification

  • ./node_modules/.bin/prettier --check developer-guide/core-features/fine-grained-control.mdx developer-guide/core-features/fine-grained-control/english.mdx developer-guide/core-features/fine-grained-control/chinese.mdx developer-guide/core-features/fine-grained-control/japanese.mdx docs.json
  • git diff --check
  • ./node_modules/.bin/mint validate (fails only on existing repository warnings: React imports in snippets and missing /snippets/snippet-intro.mdx from temp/essentials/reusable-snippets.mdx)

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guides for phoneme control across English, Chinese, and Japanese languages, including pronunciation annotation examples and code snippets.
    • Improved "Fine-grained Control" documentation structure with clearer guidance on normalization settings and practical usage tips.
    • Enhanced navigation with new language-specific phoneme control pages.

@mintlify
Copy link
Copy Markdown

mintlify Bot commented May 7, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
hanabiaiinc 🟢 Ready View Preview May 7, 2026, 4:46 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack

Warning

Rate limit exceeded

@Kilerd has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 minutes and 17 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e6af23f4-34d5-4220-a37e-728727eea7c9

📥 Commits

Reviewing files that changed from the base of the PR and between a2484ee and 42459b1.

📒 Files selected for processing (1)
  • developer-guide/core-features/fine-grained-control/english.mdx
📝 Walkthrough

Walkthrough

This PR updates documentation for fine-grained phoneme control, reformatting frontmatter and code snippets for consistency, revising normalization guidance to clarify when to disable it, and extending phoneme control with comprehensive Japanese romaji support including pitch accent markers and a Python generation script.

Changes

Fine-grained Phoneme Control (single cohort)

Layer / File(s) Summary
Frontmatter & Metadata
developer-guide/core-features/fine-grained-control.mdx, docs.json, llms.txt
Frontmatter and AudioTranscript import/snippet normalized to double quotes; navigation group added and index entry updated.
Normalization Guidance
developer-guide/core-features/fine-grained-control.mdx
"Getting Started" rewritten: default normalization recommended; "normalize": false only for preserving adjacent text like numbers, dates, URLs.
Core Phoneme Control Page
developer-guide/core-features/fine-grained-control.mdx
Phoneme control section reorganized, language card group added (English/Chinese/Japanese), quick examples inserted, and paralanguage table reformatted.
Chinese Phoneme Control
developer-guide/core-features/fine-grained-control/chinese.mdx
New page: tone-number (tone3) pinyin rules, tagging examples, polyphonic character guidance, and a pypinyin snippet for generating tone3 pinyin.
English Phoneme Control
developer-guide/core-features/fine-grained-control/english.mdx
New page: CMU Arpabet formatting and stress digits, disambiguation examples, and a cmudict Python snippet to generate pronunciations.
Japanese Phoneme Control
developer-guide/core-features/fine-grained-control/japanese.mdx
New page: OpenJTalk-style romaji with pitch-accent digit/edge notation, homograph examples, pyopenjtalk-based generator script, embedding and long-text handling guidance.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Phonemes now speak Japanese true,
With pitch accents marked one-to-four, it's new,
A Python script hops through the phoneme dance,
While guidance clarifies normalization's stance—
Documentation blooms where clarity grew!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: split fine-grained phoneme guides' accurately and concisely describes the main change: reorganizing the fine-grained control documentation by splitting it into separate language-specific pages for English, Chinese, and Japanese.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/add-japanese-phoneme-docs

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@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: 1

🧹 Nitpick comments (1)
developer-guide/core-features/fine-grained-control.mdx (1)

77-83: ⚡ Quick win

Add an explicit prerequisites block before the procedure.

This section is procedural, so list prerequisites first (for example: Python version and dependency install requirement) to improve task success.

As per coding guidelines, "Include prerequisites at the start of procedural content."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@developer-guide/core-features/fine-grained-control.mdx` around lines 77 - 83,
Insert an explicit "Prerequisites" subsection immediately before the "####
Generating Japanese Phonemes" heading that lists the required Python version
(e.g. Python 3.8+), required packages (mention pyopenjtalk and any other
dependencies), and the install step shown in the existing pip install code block
(`pip install pyopenjtalk`), so readers see environment requirements before the
procedure; update any references in the section to rely on those prerequisites
being met.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@developer-guide/core-features/fine-grained-control.mdx`:
- Around line 124-129: Add a bounds check before accessing labels[index + 1] to
avoid IndexError: before computing next_phoneme or calling _numeric_feature on
labels[index + 1], ensure index + 1 < len(labels); if out of bounds treat it
like a trailing silence (e.g., set a2_next = -1) so the logic in the block
handling next_phoneme, a2_next, and _numeric_feature remains safe when the final
label is missing.

---

Nitpick comments:
In `@developer-guide/core-features/fine-grained-control.mdx`:
- Around line 77-83: Insert an explicit "Prerequisites" subsection immediately
before the "#### Generating Japanese Phonemes" heading that lists the required
Python version (e.g. Python 3.8+), required packages (mention pyopenjtalk and
any other dependencies), and the install step shown in the existing pip install
code block (`pip install pyopenjtalk`), so readers see environment requirements
before the procedure; update any references in the section to rely on those
prerequisites being met.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a8935d33-a428-4dad-a53e-1e813f776546

📥 Commits

Reviewing files that changed from the base of the PR and between ced75a9 and b4e5e42.

📒 Files selected for processing (1)
  • developer-guide/core-features/fine-grained-control.mdx

Comment thread developer-guide/core-features/fine-grained-control.mdx Outdated
@Kilerd Kilerd changed the title docs: add Japanese phoneme control guide docs: split fine-grained phoneme guides May 7, 2026
Copy link
Copy Markdown

@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: 2

♻️ Duplicate comments (1)
developer-guide/core-features/fine-grained-control/japanese.mdx (1)

89-93: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Guard labels[index + 1] access to prevent IndexError in the example.

At Line 89, the snippet assumes a next label always exists. Add a bounds check before reading labels[index + 1].

Suggested fix
-        next_phoneme = re.search(r"\-([^\+]*)\+", labels[index + 1]).group(1)
-        if next_phoneme in ["sil", "pau"]:
+        if index + 1 >= len(labels):
             a2_next = -1
         else:
-            a2_next = int(re.search(r"\+(\d+)\+", labels[index + 1]).group(1))
+            next_phoneme = re.search(r"\-([^\+]*)\+", labels[index + 1]).group(1)
+            if next_phoneme in ["sil", "pau"]:
+                a2_next = -1
+            else:
+                a2_next = int(re.search(r"\+(\d+)\+", labels[index + 1]).group(1))
Does `pyopenjtalk.extract_fullcontext()` guarantee that the final label is always a trailing silence label (`sil`/`pau`)?
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@developer-guide/core-features/fine-grained-control/japanese.mdx` around lines
89 - 93, The code assumes labels[index + 1] exists when computing next_phoneme
and a2_next; guard the access by checking the index bounds (e.g., if index + 1 <
len(labels)) before calling re.search on labels[index + 1]; if out of range,
treat it like a trailing silence (set a2_next = -1 and skip next_phoneme
parsing) so the logic in the next_phoneme/a2_next branch remains correct; update
the block around the existing next_phoneme and a2_next assignments (references:
labels, index, next_phoneme, a2_next, and the re.search calls) to include this
bounds check.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@developer-guide/core-features/fine-grained-control.mdx`:
- Line 43: The href attributes for the language cards use absolute internal
paths (e.g. href="/developer-guide/core-features/fine-grained-control/english");
change them to relative internal links (for example "english" or "./english") so
they comply with the guideline "Use relative paths for internal links" — update
the href values shown in the snippet and the other occurrences noted (the
similar hrefs at lines mentioned in the comment) to relative paths.

In `@developer-guide/core-features/fine-grained-control/english.mdx`:
- Around line 67-89: The doc uses the Python 3.10 union type in the
cmu_pronunciation signature ("str | None"), so either add a short prerequisite
note at the top of this procedural section that the examples require Python
3.10+ or change the function signature to use typing.Optional (e.g.,
Optional[str]) and add the corresponding import from typing; update the
cmu_pronunciation definition and any related type hints to use Optional[str] if
you choose the compatibility route, or add a one-line "Requires Python 3.10+"
note before the code block if you prefer to keep the new syntax.

---

Duplicate comments:
In `@developer-guide/core-features/fine-grained-control/japanese.mdx`:
- Around line 89-93: The code assumes labels[index + 1] exists when computing
next_phoneme and a2_next; guard the access by checking the index bounds (e.g.,
if index + 1 < len(labels)) before calling re.search on labels[index + 1]; if
out of range, treat it like a trailing silence (set a2_next = -1 and skip
next_phoneme parsing) so the logic in the next_phoneme/a2_next branch remains
correct; update the block around the existing next_phoneme and a2_next
assignments (references: labels, index, next_phoneme, a2_next, and the re.search
calls) to include this bounds check.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c7e44fb0-85b3-4e87-b02f-ac8019406173

📥 Commits

Reviewing files that changed from the base of the PR and between b4e5e42 and a2484ee.

📒 Files selected for processing (6)
  • developer-guide/core-features/fine-grained-control.mdx
  • developer-guide/core-features/fine-grained-control/chinese.mdx
  • developer-guide/core-features/fine-grained-control/english.mdx
  • developer-guide/core-features/fine-grained-control/japanese.mdx
  • docs.json
  • llms.txt
✅ Files skipped from review due to trivial changes (2)
  • docs.json
  • llms.txt

<Card
title="English"
icon="language"
href="/developer-guide/core-features/fine-grained-control/english"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use relative internal links for the language cards.

These href values are internal paths; switch them to relative links for guideline compliance.

Suggested fix
-    href="/developer-guide/core-features/fine-grained-control/english"
+    href="./fine-grained-control/english"
@@
-  href="/developer-guide/core-features/fine-grained-control/chinese"
+  href="./fine-grained-control/chinese"
@@
-    href="/developer-guide/core-features/fine-grained-control/japanese"
+    href="./fine-grained-control/japanese"

As per coding guidelines, "Use relative paths for internal links" and "Do not use absolute URLs for internal links".

Also applies to: 51-51, 60-60

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@developer-guide/core-features/fine-grained-control.mdx` at line 43, The href
attributes for the language cards use absolute internal paths (e.g.
href="/developer-guide/core-features/fine-grained-control/english"); change them
to relative internal links (for example "english" or "./english") so they comply
with the guideline "Use relative paths for internal links" — update the href
values shown in the snippet and the other occurrences noted (the similar hrefs
at lines mentioned in the comment) to relative paths.

Comment on lines +67 to +89
The training pipeline uses CMUdict-style pronunciations. You can generate the same format with the `cmudict` package:

```bash
pip install cmudict
```

```python
import cmudict


entries = cmudict.dict()


def cmu_pronunciation(word: str) -> str | None:
phones = entries.get(word.lower())
if not phones:
return None
return " ".join(phones[0])


print(cmu_pronunciation("engineer"))
# EH1 N JH AH0 N IH1 R
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Does Python 3.9 support the str | None type annotation syntax, or is Python 3.10+ required?

💡 Result:

No, Python 3.9 does not support the str | None type annotation syntax. This syntax, introduced by PEP 604, requires Python 3.10 or later. In Python 3.9, using str | None raises a TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' because types do not define the | operator until 3.10 [1][2][3].

Citations:


Add a Python version prerequisite before the code snippet.

Line 80 uses str | None syntax, which requires Python 3.10+. Per your documentation guidelines, state this prerequisite at the start of this procedural section. Either add a note specifying Python 3.10+ or replace the type annotation with Optional[str] for compatibility with Python 3.9 and earlier.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@developer-guide/core-features/fine-grained-control/english.mdx` around lines
67 - 89, The doc uses the Python 3.10 union type in the cmu_pronunciation
signature ("str | None"), so either add a short prerequisite note at the top of
this procedural section that the examples require Python 3.10+ or change the
function signature to use typing.Optional (e.g., Optional[str]) and add the
corresponding import from typing; update the cmu_pronunciation definition and
any related type hints to use Optional[str] if you choose the compatibility
route, or add a one-line "Requires Python 3.10+" note before the code block if
you prefer to keep the new syntax.

@Kilerd Kilerd merged commit be7651b into main May 7, 2026
6 checks passed
@Kilerd Kilerd deleted the codex/add-japanese-phoneme-docs branch May 7, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant