Practical overview
When it fits
Use Budoux when ordinary wrapping risks breaking Japanese, Chinese or Thai text at awkward points and a small standalone segmentation component suits the text-display workflow.
Who it is for
- Developers building text-processing pipelines or interfaces that need phrase-aware line wrapping.
- Teams working with Japanese, Chinese or Thai text display.
- Developers who want to supply a custom model or explore training for another language.
Documented uses
- Split supported-language text into phrases to guide line wrapping.
- Add phrase-aware break opportunities to HTML output.
- Format text into phrase segments from a terminal.
- Use a custom JSON model with the parser.
Requirements & limits
The project is open source under the Apache-2.0 license. The README documents Python installation with pip and links package listings for Python, JavaScript and Java.
- Pretrained models are documented for four languages: Japanese, Simplified Chinese, Traditional Chinese and Thai.
- Implementations are listed for Python, JavaScript and Java; the detailed installation and usage examples in the README are for Python.
- The project describes its size as around 15 KB including the machine-learning model and says it does not depend on third-party word segmenters.
- Budoux does not sanitize HTML input; untrusted input requires a separate appropriate sanitizer.
- For Korean, the README recommends considering CSS
word-break: keep-allas a general alternative to installing Budoux.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install Budoux and parse text with Python
Install the Python package and use a pretrained Japanese parser to split a sentence into phrases.
Before you start
- Python package installation with pip
- A sentence in a supported pretrained-model language
Steps
Install the package with the command below.
pip install budouxImport
budouxin Python.Load the default Japanese parser with
budoux.load_default_japanese_parser().Pass a sentence to
parser.parse()to obtain a list of phrases.
Expected outcome
A list of phrase segments that can be used to organize line wrapping.
Guide limitations
- The example uses Japanese; pretrained models are also documented for Simplified Chinese, Traditional Chinese and Thai.
- The guide does not cover training a custom model.
Format text into line-break segments with the CLI
Use the documented command-line interface to format text with a selected supported language.
Before you start
- Budoux installed and its
budouxcommand available in the terminal - Text in Japanese, Simplified Chinese, Traditional Chinese or Thai
Steps
Provide text to the
budouxcommand.For a language other than the default Japanese, specify
-lwithzh-hans,zh-hantorth; usejafor Japanese.Read the formatted phrase segments in the command output.
Expected outcome
Text displayed as separate phrase segments for line-break organization.
Guide limitations
- The documented CLI language options are Japanese, Simplified Chinese, Traditional Chinese and Thai.
- The guide covers formatting text, not HTML sanitization.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 October 2026
- Original website title
- google/budoux · Official homepage title · retained in its source language

