Skip to content

Templates

Dennis Decoene edited this page Dec 28, 2024 · 1 revision

Sentence Templates

This page documents the pre-built sentence templates available in Semantic Seed. These templates are designed to create grammatically correct, meaningful sentences while maintaining BIP39 compatibility.

Template Usage

Templates are entirely optional and provided for convenience. You can:

  • Choose a template as a starting point
  • Modify a template to suit your needs
  • Create your own structure from scratch
  • Mix elements from different templates

The key requirement is maintaining exactly 12 or 24 words for a valid BIP39 seed phrase.

12-Word Templates

Simple Journey

A straightforward narrative about a character's movement.

Structure:

article → adjective → person → action → direction → article → adjective → place → conjunction → timeWord → action → direction

Example:

the brave warrior walks toward the ancient castle when night falls down

Double Action

A two-part narrative connecting different locations.

Structure:

article → adjective → person → action → direction → article → place → conjunction → action → direction → article → place

Example:

the swift pilot flies over the mountain and glides toward the valley

Time Adventure

A time-anchored narrative about movement and action.

Structure:

timeWord → article → adjective → person → action → direction → article → place → conjunction → action → article → place

Example:

tonight the brave hero runs through the forest and enters the castle

Place Description

A location-focused narrative with movement.

Structure:

article → adjective → place → direction → article → adjective → place → action → article → person → direction → place

Example:

the dark forest behind the ancient temple guides the warrior toward home

Double Description

Rich descriptive narrative using multiple adjectives.

Structure:

article → adjective → adjective → person → action → direction → article → adjective → adjective → place → timeWord → direction

Example:

the brave swift teacher moves toward the dark ancient castle now forward

24-Word Templates

Epic Journey

An extended narrative combining multiple actions and locations.

Structure:

article → adjective → person → action → direction → article → adjective → place → conjunction → timeWord →
article → adjective → person → action → direction → article → adjective → place → conjunction → timeWord →
action → direction → article → place

Example:

the brave warrior walks toward the ancient castle when dawn the swift doctor flies above the dark mountain and tonight moves behind the temple

Parallel Actions

Multiple characters performing different actions.

Structure:

timeWord → article → adjective → person → action → direction → article → place → conjunction →
article → adjective → person → action → direction → article → place → conjunction →
article → adjective → person → action → direction → article → place

Example:

today the quick pilot flies over the ocean while the brave warrior runs through the forest and the swift doctor moves toward the castle

Triple Location

A complex narrative connecting three different locations.

Structure:

article → adjective → person → action → direction → article → adjective → place → conjunction →
action → direction → article → adjective → place → conjunction → timeWord → action → direction →
article → adjective → place → conjunction → article → place

Example:

the swift hero moves through the ancient forest and flies toward the dark mountain when night glides above the huge castle near the ocean

Time Sequence

A narrative with three distinct temporal segments.

Structure:

timeWord → article → adjective → person → action → direction → article → place → conjunction →
timeWord → article → adjective → person → action → article → place → conjunction →
timeWord → article → adjective → person → action → article → place

Example:

dawn the brave warrior walks toward the castle and morning the swift pilot enters the mountain while night the quick doctor leaves the temple

Complex Journey

A sophisticated narrative with multiple movements and temporal elements.

Structure:

article → adjective → person → action → direction → article → adjective → place → conjunction →
article → adjective → person → action → direction → article → adjective → place → timeWord →
conjunction → action → direction → article → adjective → place

Example:

the brave warrior moves through the ancient forest and the swift pilot flies over the dark mountain tonight then glides toward the huge castle

Word Categories Used

Templates use words from these categories:

  • Article: a, an, the, this, that, these, those, any, all
  • Adjective: Descriptive words like brave, swift, dark, ancient
  • Person: Character words like warrior, pilot, doctor, hero
  • Action: Movement verbs like walk, run, fly, glide
  • Direction: Spatial words like toward, through, over, behind
  • Place: Location words like castle, forest, mountain, valley
  • TimeWord: Temporal words like dawn, night, morning, today
  • Conjunction: Connecting words like and, when, while

See the Word Categories page for complete word lists in each category.

Creating Custom Structures

When creating your own sentence structure:

  1. Word Count: Ensure exactly 12 or 24 words
  2. Grammar: Try to maintain basic grammatical structure for memorability
  3. Flow: Aim for natural-sounding sentences
  4. Categories: Mix categories in a way that creates meaningful phrases
  5. Testing: Generate several phrases to ensure your structure creates sensible sentences

Implementation Details

The template system:

  • Uses lodash for random word selection within categories
  • Maintains BIP39 compatibility
  • Allows drag-and-drop reordering
  • Supports real-time generation
  • Validates all generated phrases

For technical details about template implementation, see the source code in src/components/SentenceTemplate.tsx.