Skip to main content
Version: v0.0.2

Function: applyGem()

applyGem(map, source): GemApplyResult

Apply a loaded GEM map to a source code, in the map's authored direction only.

Returns the full candidate set (never collapsed to one), with each entry's steward flags; a combination source additionally surfaces its scenario/choice-list structure. A source the steward marked No-Map (NoDx sentinel) is a typed CrosswalkNoMap; a source absent from the map is a typed CrosswalkUnmapped - the two are distinct, and neither is ever a fabricated code.

Parameters

map

GemMap

A GemMap from loadGems.

source

string

The source code (in the map's source classification).

Returns

GemApplyResult

A GemApplyResult.

Example

import { loadGems, applyGem } from "@cosyte/terminology";

const gems = loadGems({ direction: "9-to-10", content: "V290 NoDx 11000\n" });
const r = applyGem(gems, "V290");
r.mapped; // => false