GuardVocabulary

data class GuardVocabulary(val stopwords: Set<String>, val sentenceOpeners: Set<String>, val nonEntityCapitals: Set<String>, val negationMarkers: Set<String>, val antonyms: Set<Pair<String, String>>, val temporalMarkers: Set<String>, val scopeMarkers: Set<String>, val directionalCues: Set<String>, val units: Map<String, MeasurementUnit>)

The complete set of word lists the standard guards read from, bundled so a whole language can be swapped in one object.

Every guard already takes its markers as a constructor parameter, so adapting kmemo to another language was always possible — this makes it one line. MatchGuards.standard takes a GuardVocabulary, and dev.kmemo.guard.Vocabularies ships curated ones for the highest-traffic languages. Build your own from a language's traffic when a shipped pack does not fit; the same conservative rule applies as for English — a marker earns its place only if it will not reject a genuine paraphrase.

Parameters

stopwords

function words removed before comparison; read by most guards.

sentenceOpeners

words that may open a sentence without naming anything (the entity guard).

nonEntityCapitals

words capitalized by grammar, not reference (the entity guard).

negationMarkers

words that negate (the negation guard).

antonyms

symmetric pairs that flip an answer (the antonym guard).

temporalMarkers

absolute time references (the temporal guard).

scopeMarkers

words describing the shape of the answer — format, length, depth (the scope guard).

directionalCues

cues that make argument order significant — comparisons, conversions (the direction guard).

units

unit and currency tokens mapped to a canonical MeasurementUnit (the unit & substitution guards).

Constructors

Link copied to clipboard
constructor(stopwords: Set<String>, sentenceOpeners: Set<String>, nonEntityCapitals: Set<String>, negationMarkers: Set<String>, antonyms: Set<Pair<String, String>>, temporalMarkers: Set<String>, scopeMarkers: Set<String>, directionalCues: Set<String>, units: Map<String, MeasurementUnit>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard