Optimality is a TypeScript package which implements common constraints from Optimality Theory and provides a clear, typed interface for reasoning about them.
const input = "hen"const candidates =word: "hen"correspondence: 0 1 2word: "he"correspondence: 0 1 nullconst constraints = MAX NOCODAconst result =
$ yarn add optimality
$ npm install optimality
||(From tipa) A group of syllables and the end result of parsing.|
||Any function which takes a candidate word and returns the number of violations.|
||Any function which takes an input word, a candidate word, and a correspondence between the two and returns the number of violations.|
||A mapping between two words. An array of