公開前の確認用サイト
日常訳NICHIJOYAKUEnglish ↗

SOURCE EXPLORER / 資料ブラウザー

style.py

実装と資料を、行ごとに確かめる。

日常訳はAIを用いて作成された翻訳です。人間の聖書学・原語の専門家による全訳の検証は確認されていません。既存の翻訳や原語資料と照らし合わせてお読みください。

style.py352 行原本を保存 ↓

verbatim snapshot · cli/translate-bible/src/models/style.py

出典とハッシュ

資料取得日: 2026-10-03. 取得元の詳細は資料インデックスを参照。

SHA-256 75bb19cd2861b649704fafdc97f1782a800433bb7d3de22957da1a548706665b

index.json ↗

関数・クラスへ移動 (10)

行番号は、その行へのリンクです。ページ内検索は ⌘F / Ctrl+F。

1"""Translation style configuration models."""23from __future__ import annotations45from dataclasses import dataclass, field6from enum import Enum789class EquivalenceApproach(str, Enum):10    """Translation equivalence approach."""1112    FORMAL = "formal"  # Word-for-word, structure preserving13    DYNAMIC = "dynamic"  # Thought-for-thought, meaning preserving14    OPTIMAL = "optimal"  # Balance between formal and dynamic151617class GenderLanguage(str, Enum):18    """Gender language approach."""1920    TRADITIONAL = "traditional"  # Preserve masculine generics21    MODERATE_INCLUSIVE = "moderate_inclusive"  # Inclusive for clearly generic refs22    FULLY_INCLUSIVE = "fully_inclusive"  # Always use gender-neutral language232425class ReadabilityLevel(str, Enum):26    """Target readability level."""2728    SCHOLARLY = "scholarly"  # Academic/theological audience29    GENERAL_PUBLIC = "general_public"  # Everyday readers30    WEB_NATIVE = "web_native"  # Young adults raised on online media31    CHILDREN = "children"  # Simplified for younger readers323334class TheologicalTradition(str, Enum):35    """Theological interpretive tradition."""3637    EVANGELICAL = "evangelical"  # Protestant evangelical38    CATHOLIC = "catholic"  # Roman Catholic39    ORTHODOX = "orthodox"  # Eastern Orthodox40    ECUMENICAL = "ecumenical"  # Cross-traditional414243class TermConsistency(str, Enum):44    """Term translation consistency approach."""4546    STRICT = "strict"  # Always same translation for same term47    BALANCED = "balanced"  # Consistent for key terms, contextual for common words48    CONTEXTUAL = "contextual"  # Prioritize natural reading, vary by context495051class FormalityLevel(str, Enum):52    """Japanese formality level."""5354    CASUAL = "casual"  # Plain form (だ/である)55    STANDARD = "standard"  # Mainstream translation register (plain narrative)56    POLITE = "polite"  # Friendly です/ます narration (リビングバイブル-like)57    FORMAL = "formal"  # Highly formal/literary585960@dataclass61class TranslationStyle:62    """Configuration for translation style and approach.6364    This dataclass encapsulates all configurable aspects of the65    translation philosophy and target style.66    """6768    equivalence_approach: EquivalenceApproach = EquivalenceApproach.DYNAMIC69    gender_language: GenderLanguage = GenderLanguage.MODERATE_INCLUSIVE70    readability_level: ReadabilityLevel = ReadabilityLevel.WEB_NATIVE71    theological_tradition: TheologicalTradition = TheologicalTradition.EVANGELICAL72    textual_basis: str = "MorphGNT/SBLGNT"73    term_consistency: TermConsistency = TermConsistency.BALANCED74    formality_level: FormalityLevel = FormalityLevel.STANDARD75    avoid_archaic: list[str] = field(76        default_factory=lambda: ["なり", "たり", "候"]77    )78    target_style_reference: str = "現代のウェブ記事・ナレーションのような平易な日本語"79    additional_instructions: str | None = None8081    def to_dict(self) -> dict:82        """Convert to dictionary for serialization."""83        return {84            "equivalence_approach": self.equivalence_approach.value,85            "gender_language": self.gender_language.value,86            "readability_level": self.readability_level.value,87            "theological_tradition": self.theological_tradition.value,88            "textual_basis": self.textual_basis,89            "term_consistency": self.term_consistency.value,90            "formality_level": self.formality_level.value,91            "avoid_archaic": self.avoid_archaic,92            "target_style_reference": self.target_style_reference,93            "additional_instructions": self.additional_instructions,94        }9596    @classmethod97    def from_dict(cls, data: dict) -> TranslationStyle:98        """Create from dictionary."""99        return cls(100            equivalence_approach=EquivalenceApproach(101                data.get("equivalence_approach", "dynamic")102            ),103            gender_language=GenderLanguage(104                data.get("gender_language", "moderate_inclusive")105            ),106            readability_level=ReadabilityLevel(107                data.get("readability_level", "web_native")108            ),109            theological_tradition=TheologicalTradition(110                data.get("theological_tradition", "evangelical")111            ),112            textual_basis=data.get("textual_basis", "MorphGNT/SBLGNT"),113            term_consistency=TermConsistency(114                data.get("term_consistency", "balanced")115            ),116            formality_level=FormalityLevel(117                data.get("formality_level", "standard")118            ),119            avoid_archaic=data.get("avoid_archaic", ["なり", "たり", "候"]),120            target_style_reference=data.get(121                "target_style_reference", "現代のウェブ記事・ナレーションのような平易な日本語"122            ),123            additional_instructions=data.get("additional_instructions"),124        )125126127# Prompt text templates for each style option128129EQUIVALENCE_PROMPTS = {130    EquivalenceApproach.FORMAL: """EQUIVALENCE APPROACH: Formal131- Prioritize word-for-word translation to preserve original structure132- Maintain source language word order where possible in Japanese133- Keep Greek/Hebrew idioms even if slightly unusual in Japanese134- Focus on consistency of form over natural readability""",135    EquivalenceApproach.DYNAMIC: """EQUIVALENCE APPROACH: Dynamic/Functional136- Prioritize thought-for-thought translation over word-for-word literalism137- Ask "how would a native Japanese speaker naturally express this idea?"138- Preserve the meaning and impact, not necessarily the exact syntax139- Restructure sentences for natural Japanese flow when needed""",140    EquivalenceApproach.OPTIMAL: """EQUIVALENCE APPROACH: Optimal Equivalence141- Balance form and meaning preservation142- Keep form where it doesn't impede comprehension143- Adjust form only when necessary for clear communication144- Preserve key rhetorical features of the original""",145}146147GENDER_PROMPTS = {148    GenderLanguage.TRADITIONAL: """GENDER LANGUAGE: Traditional149- Preserve masculine generic references as in the original150- ἀδελφοί (adelphoi): render as "兄弟" (brothers)151- ἄνθρωπος (anthropos): use "人" but don't change gender-specific terms152- Maintain traditional patriarchal language where present""",153    GenderLanguage.MODERATE_INCLUSIVE: """GENDER LANGUAGE: Moderate Inclusive154- Use gender-inclusive language for clearly generic references155- ἀδελφοί (adelphoi): render as "兄弟姉妹" when context indicates mixed group156- ἄνθρωπος (anthropos): use "人" or "人々" for generic humanity, not just "男"157- Preserve gender-specific language where the original clearly indicates it""",158    GenderLanguage.FULLY_INCLUSIVE: """GENDER LANGUAGE: Fully Inclusive159- Use gender-neutral language throughout where possible160- ἀδελφοί (adelphoi): always render as "兄弟姉妹" or "きょうだい"161- Avoid masculine generics entirely162- Rephrase to eliminate unnecessary gendered terms""",163}164165READABILITY_PROMPTS = {166    ReadabilityLevel.SCHOLARLY: """READABILITY: Scholarly167- Target academic and theological readers168- Use technical theological vocabulary with precision169- Preserve complex sentence structures when meaningful170- Prioritize accuracy over accessibility""",171    ReadabilityLevel.GENERAL_PUBLIC: """READABILITY: General Public172- Target everyday readers, not scholars173- Avoid theological jargon; use accessible vocabulary174- Prefer common words over technical terms175- Aim for natural conversational Japanese""",176    ReadabilityLevel.CHILDREN: """READABILITY: Children/Youth177- Use simple vocabulary appropriate for young readers178- Break complex sentences into shorter ones179- Explain difficult concepts within the translation180- Prioritize clarity and engagement""",181    ReadabilityLevel.WEB_NATIVE: """READABILITY: Web-native (young adults, online-media register)182- Target readers in their 20s whose daily reading is online: news apps, blogs,183  social media, and scripts/subtitles of popular Japanese creators184- Short sentences: one idea per sentence; prefer two short sentences over one long one185- Everyday vocabulary only — if a word would not appear in a LINE News article186  or a popular YouTuber's narration, replace it with one that would187  (遣わす→送る, 戒める→注意する, 憩わせる→休ませる, 〜のゆえに→〜だから)188- Prefer native Japanese words (和語) over stiff literary Sino-Japanese189  compounds (漢語) when the meaning allows190- Sentence-initial connectives are welcome and natural (でも、だから、それで、そして)191- The rhythm should feel like clear spoken narration, not a printed literary text192- NEVER trade meaning for smoothness: meaning must stay exactly equivalent to193  the Greek/Hebrew. When a concept is hard, say it in plain words — do not194  omit or dilute it195- Keep every concrete content word from the source: distinct objects stay196  distinct (rod AND staff, not staff twice), negated objects stay explicit197  ("fear no evil", not "fear nothing"), and events are not reinterpreted198  ("there was light", not "light appeared"). Modernize the wording, never199  the content200- In poetry, plain vocabulary must still carry the imagery — keep every201  picture (shepherd, valley, table, cup) vivid and concrete""",202}203204TRADITION_PROMPTS = {205    TheologicalTradition.EVANGELICAL: """THEOLOGICAL TRADITION: Protestant Evangelical206- Follow Protestant canon and interpretive tradition207- Translate key theological terms in line with evangelical understanding208- Examples: δικαιοσύνη as "義" (righteousness), σωτηρία as "救い" (salvation)""",209    TheologicalTradition.CATHOLIC: """THEOLOGICAL TRADITION: Catholic210- Follow Catholic canon and interpretive tradition211- Include deuterocanonical perspectives where relevant212- Use terminology consistent with Catholic teaching""",213    TheologicalTradition.ORTHODOX: """THEOLOGICAL TRADITION: Eastern Orthodox214- Follow Orthodox canon and interpretive tradition215- Reflect Orthodox theological emphasis216- Preserve liturgical sensibility in translation""",217    TheologicalTradition.ECUMENICAL: """THEOLOGICAL TRADITION: Ecumenical218- Seek common ground across Christian traditions219- Avoid translation choices that favor one tradition220- Use broadly acceptable theological terminology""",221}222223CONSISTENCY_PROMPTS = {224    TermConsistency.STRICT: """TERM CONSISTENCY: Strict Concordance225- Always translate the same word with the same Japanese term226- Maintain rigid consistency across all occurrences227- Prioritize concordance over natural reading""",228    TermConsistency.BALANCED: """TERM CONSISTENCY: Balanced229- Maintain consistent translation for key theological terms (provided in glossary)230- Allow contextual variation for common words where meaning shifts231- Prioritize natural reading over rigid concordance for non-technical vocabulary""",232    TermConsistency.CONTEXTUAL: """TERM CONSISTENCY: Contextual233- Vary translation based on context and nuance234- Prioritize natural reading in each passage235- Use different translations for the same word when context differs""",236}237238FORMALITY_PROMPTS = {239    FormalityLevel.CASUAL: """FORMALITY: Casual (だ/である)240- Use plain form throughout241- Suitable for personal reading and study242- More direct and intimate tone""",243    FormalityLevel.STANDARD: """FORMALITY: Standard (mainstream translation register)244- Narrative, exposition, and poetry: plain form (である体/だ体), as in 新共同訳 and 口語訳245- Polite form (です/ます) ONLY inside quoted speech, when natural for the speaker246- Keep the same register consistently across every verse of a passage""",247    FormalityLevel.POLITE: """FORMALITY: Polite friendly narration (です/ます)248- Narrate in warm, natural です/ます form, like リビングバイブル or a friendly storyteller249- Inside quoted speech, use whatever register fits the speaker and scene250- Keep the same narration register consistently across every verse of a passage""",251    FormalityLevel.FORMAL: """FORMALITY: Formal/Literary252- Use formal literary style253- Suitable for liturgical and ceremonial use254- Elevated register with traditional phrasing""",255}256257258def build_system_prompt(style: TranslationStyle) -> str:259    """Build a system prompt from a TranslationStyle configuration.260261    Args:262        style: The translation style configuration.263264    Returns:265        Complete system prompt string.266    """267    parts = [268        "You are an expert Bible translator creating a modern Japanese translation.",269        "",270        "=== TRANSLATION PHILOSOPHY ===",271        "",272        EQUIVALENCE_PROMPTS[style.equivalence_approach],273        "",274        GENDER_PROMPTS[style.gender_language],275        "",276        READABILITY_PROMPTS[style.readability_level],277        "",278        TRADITION_PROMPTS[style.theological_tradition],279        "",280        f"TEXTUAL BASIS: {style.textual_basis}",281        "- Follow the provided source text without incorporating textual variants",282        "- Do not emend or correct based on other manuscript traditions",283        "",284        CONSISTENCY_PROMPTS[style.term_consistency],285        "",286        "=== TARGET AUDIENCE ===",287        "The translation should be accessible to young adult Japanese nonbelievers who are not familiar with Christianity.",288        "- Use vocabulary and expressions that require no prior church background",289        "- Explain concepts through natural phrasing rather than relying on traditional Christian terminology",290        "- Avoid insider language that would confuse those unfamiliar with the faith",291        "- HOWEVER: No compromise should be made in conveying the true Biblical meaning of the text",292        "- Accuracy to the original meaning takes absolute priority over accessibility",293        "- When tension exists between accessibility and faithfulness, choose faithfulness",294        "",295        "=== TARGET STYLE ===",296        f"Modern natural Japanese ({style.target_style_reference})",297        "- Use contemporary vocabulary and grammar",298    ]299300    if style.avoid_archaic:301        archaic_str = "、".join(style.avoid_archaic)302        parts.append(f"- Avoid archaic expressions ({archaic_str})")303304    parts.append(FORMALITY_PROMPTS[style.formality_level].split("\n")[1])305    parts.append(306        "- Orthography: first-person singular is わたし (hiragana, not 私), "307        "following mainstream Japanese Bible convention; keep orthography "308        "consistent across a passage"309    )310    parts.append("- Prioritize clarity and accessibility")311312    if style.additional_instructions:313        parts.extend(["", "=== ADDITIONAL INSTRUCTIONS ===", style.additional_instructions])314315    parts.extend(316        [317            "",318            "=== LITERARY QUALITY (by genre) ===",319            "Match the literary character of the source genre:",320            "- Hebrew poetry (Psalms, poetic passages): preserve the parallel line structure,",321            "  concrete imagery, and quiet rhythm; keep lines terse — do not flatten into prose",322            "- Narrative (Gospels, Genesis): clear, flowing storytelling prose;",323            "  preserve deliberate repetition and refrains (e.g. creation formulas)",324            "- Epistles (Paul): keep the logical connectives (だから、なぜなら、しかし今や)",325            "  and the argument's flow visible; do not break one flowing thought into fragments",326            "- Sayings/beatitudes: preserve the parallel formula across the whole series",327            "",328            "=== VERSE COHESION ===",329            "A verse is often part of a longer sentence. Use the preceding and following",330            "verses provided in CONTEXT to make your translation read as a smooth continuation:",331            "- If the verse continues a sentence begun earlier, translate it so it flows",332            "  naturally from the preceding verse (no abrupt fragment openings)",333            "- If the sentence continues into the next verse, end in a form that leads on naturally",334            "- Keep terminology and register identical to the surrounding verses",335            "",336            "=== INPUT FORMAT ===",337            "You will receive:",338            "1. Source text (Greek for NT, Hebrew for OT)",339            "2. Reference translations (historical Japanese and English)",340            "3. Surrounding context (preceding and following verses)",341            "4. Glossary terms to use consistently",342            "",343            "=== OUTPUT CONTRACT (strict) ===",344            "Output ONLY the final Japanese translation of the target verse.",345            "- No explanations, notes, romanization, or commentary",346            "- No alternative renderings, no self-corrections, no English of any kind",347            "- Decide on your final wording BEFORE writing; output exactly one rendering",348        ]349    )350351    return "\n".join(parts)352