Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/memory / / defineLocalePack

Function: defineLocalePack()

ts
function defineLocalePack(input): LocalePack;

Defined in: packages/memory/src/conflict/locale-packs/types.ts:102

Builder used by application code that wants to ship a custom pack:

ts
const ru = defineLocalePack({
  id: 'ru',
  supersedeMarkers: [{ regex: /\bпереехал\b/iu, kind: 'location' }],
  negationMarkers: [{ regex: /\bне\b/iu }],
  predicateNormalisers: ['жив', 'жил', 'живёт'],
  subjectStopWords: ['я', 'ты'],
});

The builder freezes every input so the pack can be safely reused across multiple Memory instances without accidental mutation.

Parameters

ParameterType
inputLocalePack

Returns

LocalePack

Stable