DEV Community

Ian
Ian

Posted on

Japanese wedding taboo words as open JSON: why etiquette needs to be machine-readable

I build an AI tool that writes wedding speeches in Japanese, French, Spanish and English. The hardest part was not the generation. It was the etiquette.

Japanese weddings have a concept called imikotoba (忌み言葉) — words you avoid because they suggest separation, ending, or repetition. Say 切る ("to cut") in a wedding speech and the room notices. Say 別れる ("to part") and someone's grandmother quietly disapproves.

The problem

Every LLM will happily write a fluent Japanese wedding speech. Almost none of them know that 終わる ("to end") is a landmine in that context, or that 戻る ("to return") suggests going back to a previous state — not something you want in a blessing.

Prompting helps. It does not solve it. Because:

  • The list is not in the training data in a structured way
  • Post-generation filtering needs an actual list
  • "Avoid these words" is useless without knowing what to say instead

So I extracted the list from my own content library and published it.

What's in the dataset

5 categories, 19 word pairs, plain JSON:

  • wakare — separation (切る, 別れる, 離れる)
  • owari — ending or returning (終わる/終わり, 戻る, 帰る)
  • kasane — repeated words (たびたび, ますます, 重ね重ね)
  • suuji — the numbers 4 and 9 (死 / 苦)
  • sonota — everything else

Each pair has avoid and instead. It's licensed CC-BY-4.0, so commercial use is fine.

Repo: https://github.com/johnsiebyron-stack/imikotoba
It's also on npm as imikotoba if you'd rather import it. (speechkobo.com is the product this came from.)

The part that surprised me

I added a small helper that splits variants on slashes and middots. Turned out this matters a lot.

The raw data has entries like 終わる/終わり and 倒れる・落ちる・枯れる. If you naively match the whole string, you match nothing. My first version did exactly that and silently missed every variant.

// Before: matches nothing
text.includes("終わる/終わり") // false

// After: split into base forms
baseForms("終わる/終わり") // ["終わる", "終わり"]
Enter fullscreen mode Exit fullscreen mode

That bug would have shipped. The test caught it, which is the only reason I'm writing this post instead of quietly failing in production.

Tradeoff: false positives

I use substring matching on purpose. 区切る contains 切る, and find() will flag it.

That's a deliberate choice. In a speech checker, a false positive costs you two seconds. A false negative costs you the moment. But if you need precision, you'll have to filter — and the README says so explicitly instead of pretending the library is smarter than it is.

What I'd tell anyone building in a non-English market

  1. The etiquette layer is not optional. Generic generation gets you 80% of the way. The last 20% is local knowledge that isn't in any API.
  2. Publish the data separately from the product. It forces you to make it explicit, and it makes your own prompt shorter.
  3. Count characters, not words. Japanese speech timing is ~300 characters per minute. English is ~150 words per minute. Same 3 minutes, completely different target numbers.

Feedback welcome

If you know Japanese wedding customs better than I do, the dataset is wrong somewhere and I'd like to know where. Issues and PRs are open. The list is a practical one, not an authoritative source — regional and family customs differ, and I'd rather fix specifics than defend the list as-is.

Top comments (0)