API ReferenceGE Extensionsgameplayrallyutil
Rally Utility Normalizer
Simple text normalization module that applies word-replacement mappings to pacenote strings.
Simple text normalization module that applies word-replacement mappings to pacenote strings.
Public API
| Function | Signature | Returns | Description |
|---|---|---|---|
replaceWords | (word_map, note) | string | Apply all word replacements from mapping table to note text |
M.replaceWords | (word_map, note) | - | replaceWords handler |
How It Works
Takes a word map (array of {from, to} pairs) and applies each replacement sequentially using Lua's string.gsub:
local normalizer = require('gameplay/rally/util/normalizer')
local word_map = {
{"(%d+) left", "%1L"},
{"(%d+) right", "%1R"},
{"straight", "flat"},
}
local result = normalizer.replaceWords(word_map, "3 left into straight")
-- result = "3L into flat"Notes
- Replacements are applied sequentially, so earlier replacements can affect later ones
- Returns the input unchanged if
noteis nil - The
frompatterns support Lua pattern syntax (e.g.,%d+for digits) - Used to normalize speech-to-text output into standardized pacenote notation
See Also
- Rally Utility Colors - Related reference
- Rally JSONL Utilities - Related reference
- Gameplay Systems Guide - Guide
Rally JSONL Utilities
Utility module for reading JSON Lines (JSONL) files - line-delimited JSON format used for recce recordings (driveline, cuts, transcripts).
Gameplay Race Route
Extended version of `route.lua` designed for racing. Adds metadata support, callbacks for route events, original position tracking for re-routing, and merge-priority handling for close waypoints.