Claude Code Plugins

Community-maintained marketplace

Feedback

multi-language-document-processing

@findinfinitelabs/chuuk
0
20

Process documents in multiple languages with focus on low-resource languages, accented character systems, and cross-linguistic content analysis. Use when working with minority languages, mixed-language documents, or documents with special characters and diacritical marks.

Install Skill

Shared

Installs to .agents/skills, used by Codex, Amp, Warp, Cursor, OpenCode, and more.

CodexAmp
Warp
CursorOpenCode
Cline
Gemini CLI
GitHub Copilot
Personal

Available across projects.

$npx skills-installer add @findinfinitelabs/chuuk/multi-language-document-processing --client shared
Project

Writes to .agents/skills.

$npx skills-installer add @findinfinitelabs/chuuk/multi-language-document-processing -p --client shared
Note: Review the skill instructions before using it.

SKILL.md

name multi-language-document-processing
description Patterns for documents that mix Chuukese + English (and occasionally other JW.org locales) — sentence segmentation, scripture-safe chunking, and per-language sentence stores. Use when ingesting bilingual brochures/articles or building parallel corpora.

Multi-Language Document Processing

Most JW source material the dictionary ingests is bilingual or interleaved — a Chuukese paragraph followed by its English original, or scripture references that resolve to either language. This skill covers the actual patterns the repo uses; deeper Chuukese-specific guidance lives in chuukese-language-processing.

Where multilingual material lives

Sentence segmentation

IntelligentTextChunker (src/utils/intelligent_chunker.py) carries a multi-language sentence-ending table:

{
  "english":  [".", "!", "?", ";"],
  "chuukese": [".", "!", "?"],
  "general":  [".", "!", "?", ";", "。", "!", "?"],
}

For most extraction work, general is the safe default. When you know the language, prefer the language-specific list — it avoids over-splitting on English semicolons in Chuukese text.

Scripture-safe processing

Scripture references frequently appear inside both Chuukese and English text and must not be split. Always wrap chunking with the protect/restore helpers from `src/utils/scripture_parser.py`. The reference regex matches both English (1 Cor. 13:4) and Chuukese (Féf. 5:42) book aliases driven by `config/scripture_books.json`. See the scripture-reference-parsing skill.

Building parallel sentence pairs

For brochures and articles where layout pairs CHK+EN side by side:

  1. Extract per-language sentence lists with `scripts/extract_brochure_sentences.py` or `scripts/extract_jwpub.py`.
  2. Align by position + length ratio — this is what the existing scripts do, with no learned alignment. It works because JW publications maintain strict sentence-by-sentence parallelism.
  3. Filter pairs whose len(en) / len(chk) falls outside [0.5, 2.5] — those are usually misalignments.
  4. Hand the pairs to `AITrainingDataGenerator.export_training_data` for jsonl/huggingface/ollama formats.

Mixed-language detection

For ad-hoc text, use the same heuristic the translation engines use:

import re
def detect_lang(text: str) -> str:
    has_latin = bool(re.search(r"[a-zA-Z]", text))
    has_chk_accents = bool(re.search(r"[áéíóúāēīōū]", text))
    if has_chk_accents: return "chuukese"
    if has_latin: return "english"
    return "unknown"

This is heuristic-only — Chuukese without diacritics looks Latin/English. For high-stakes routing, prefer langid/fasttext, but the heuristic is what the production translate endpoint uses (app.py).

Pitfalls

  • Don't text.lower() Chuukese — it's safe in pure ASCII text but loses information when applied to glyphs that might combine differently across NFC/NFD.
  • NFC normalize Unicode before comparison: unicodedata.normalize("NFC", text). Brochure exports are inconsistent.
  • The "page footer" line on JW publications usually contains language hints (chk / en slugs in URLs). Keep them — they're useful for downstream sanity checks even though they're noise for training.
  • Mixing Bible-verse data with brochure data into a single training file is fine, but tag the source — quality issues bias differently per source.