Servidor MCP

word-aligner

io.github.tinygodsdev/word-aligner
Diseño y creatividad Educación Público y accesible MCP 2026-07-28

Qué hace este MCP

Creates shareable visual diagrams aligning words across translations, glosses, or other stacked text lines.

create_word_alignment
Create word alignment diagram
Create a shareable Word Aligner diagram that shows which words match across two or more stacked lines of text (a translation and its source, an interlinear gloss, IPA, etc.). Returns a URL that opens the interactive diagram, plus a preview image. Use this when the user wants to translate a phrase and show word correspondences, align a translation with its source (including RTL scripts like Hebrew or Arabic, or vertically written ones like Japanese and Mongolian), or build a Leipzig-style interlinear gloss. Word indices are 0-based token positions. Tokenize each line the same way the tool does before assigning indices: - Whitespace always splits ("I have been going" -> I[0] have[1] been[2] going[3]). - The characters in settings.tokenSplitChars (default ".-|") also split and are then removed from the rendered text, so "go.PST.IPFV" becomes three tokens (go, PST, IPFV) and the dots disappear. For Leipzig glosses set tokenSplitChars to "-|" to keep the dots. - Punctuation stays attached by default ("Hello, world!" -> Hello,[0] world![1]). - In RTL lines, word 0 is the logically first word (rightmost on screen); index in reading order. - Japanese and Chinese are written without spaces and nothing is segmented for you: put spaces where the alignment units should be. For a vertically written script set settings.axis to "columns". Every line then becomes a vertical column and the connectors run sideways. Set orientation per line: "vertical" stacks the characters (Japanese, Chinese), "sideways" rotates the line a quarter turn (traditional Mongolian, and Latin runs inside vertical text), "upright" leaves a translation as horizontal word boxes. The first line is the leftmost column, so for Japanese and Chinese, whose columns read right to left, list the translation first and the script second. Each alignment is [lineA, wordA, lineB, wordB]; the two lines must be neighbours in the stack (|lineA - lineB| = 1), which means one above the other in rows and side by side in columns. To express many-to-one, list each target word as its own tuple. Tokens that share a connection group get the same color automatically.
Solo lectura Idempotente
Esquema de entrada
{'type': 'object', 'required': ['lines'], 'properties': {'lines': {'type': 'array', 'items': {'oneOf': [{'type': 'string', 'description': 'Plain line text (shorthand).'}, {'type': 'object', 'required': ['text'], 'properties': {'rtl': {'type': 'boolean', 'description': 'Right-to-left layout (Hebrew, Arabic, ...). Default false.'}, 'font': {'type': 'string', 'description': 'Google Fonts family name (e.g. "Noto Sans Hebrew"). Defaults to Inter.'}, 'text': {'type': 'string', 'description': 'Line text.'}, 'gapPx': {'type': 'integer', 'maximum': 56, 'minimum': 0, 'description': 'Horizontal gap between word tokens in px. Default 14.'}, 'sizePx': {'type': 'integer', 'maximum': 64, 'minimum': 12, 'description': 'Text size in px. Default 36.'}, 'orientation': {'enum': ['upright', 'vertical', 'sideways'], 'type': 'string', 'description': 'How this line\'s glyphs are set, visible with settings.axis "columns". "vertical" stacks characters (Japanese, Chinese), "sideways" rotates the line (Mongolian). Default "upright".'}}, 'additionalProperties': False}]}, 'maxItems': 8, 'minItems': 1, 'description': 'Text lines, top to bottom. Each entry is a plain string or an object with per-line visual options.'}, 'pairs': {'type': 'array', 'items': {'type': 'object', 'required': ['upper', 'lower'], 'properties': {'gapPx': {'type': 'integer', 'maximum': 156, 'minimum': 12, 'description': 'Vertical gap between the two lines in px. Default 120.'}, 'lower': {'type': 'integer', 'description': '0-based index of the lower line (must equal upper + 1).'}, 'upper': {'type': 'integer', 'description': '0-based index of the upper line.'}, 'showConnectors': {'type': 'boolean', 'description': 'Draw connectors between this pair. Default true.'}}, 'additionalProperties': False}, 'description': 'Per-pair controls for a specific adjacent line pair.'}, 'settings': {'type': 'object', 'properties': {'axis': {'enum': ['rows', 'columns'], 'type': 'string', 'description': 'Flow direction of the diagram. "rows" (default) stacks lines downward with vertical connectors. "columns" stands each line up as a vertical column with sideways connectors, for Japanese, Chinese, and Mongolian; the first line is the leftmost column.'}, 'theme': {'enum': ['light', 'dark'], 'type': 'string', 'description': 'UI theme (token chip color). Default light.'}, 'palette': {'enum': ['pastel', 'vivid'], 'type': 'string', 'description': 'Connection color palette. Default pastel.'}, 'lineStyle': {'enum': ['straight', 'curved'], 'type': 'string', 'description': 'Connection line shape. Default curved.'}, 'background': {'enum': ['light', 'dark'], 'type': 'string', 'description': 'Preview background. Default light.'}, 'lineOpacity': {'type': 'number', 'maximum': 1, 'minimum': 0.2, 'description': 'Connection line opacity. Default 1.'}, 'showNumbers': {'type': 'boolean', 'description': 'Show line numbers. Default false.'}, 'lineThickness': {'type': 'number', 'maximum': 8, 'minimum': 1, 'description': 'Connection line thickness. Default 3.'}, 'tokenMergeChar': {'type': 'string', 'maxLength': 1, 'description': 'Single char that joins parts into one token rendered with a space (e.g. "is+playing"). Default "+".'}, 'tokenSplitChars': {'type': 'string', 'description': 'Characters (besides whitespace) that split text into tokens and are then removed. Default ".-|". Set "-|" to keep periods in Leipzig glosses.'}, 'colorTokensByLink': {'type': 'boolean', 'description': 'Tint word tokens in their connection color. Default true.'}}, 'description': 'Global visual overrides. Unset fields inherit defaults.', 'additionalProperties': False}, 'alignments': {'type': 'array', 'items': {'type': 'array', 'items': {'type': 'integer'}, 'maxItems': 4, 'minItems': 4}, 'description': 'Word-alignment links as [lineA, wordA, lineB, wordB] (0-based indices, lines must be adjacent).'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', 'required': ['url'], 'properties': {'url': {'type': 'string', 'description': 'The shareable diagram URL. Return this to the user exactly as received, character for character.'}}}
Añadido
create_word_alignment
17 de September de 2026 a las 12:52