@palasimi/ipa-cluster
Version:
Cluster words with similar IPA transcriptions together
35 lines • 878 B
TypeScript
import { Constraint } from "./ir";
import { SequenceSound } from "./operators";
import { SquashedIR } from "./squash";
/**
* A rule without `UnionSound`s.
* An `ExpandedRule` indicates that the sequence of IPA segments on the `left`
* is equivalent to the sequence on the `right`.
*/
export type ExpandedRule = {
constraint: Constraint;
left: SequenceSound;
right: SequenceSound;
};
/**
* An intermediate representation without `UnionSound`s.
*/
export type ExpandedIR = {
rules: ExpandedRule[];
};
/**
* Expands rules with unions of sounds into a collection of rules.
* For example, `{a b c} ~ {x y}` becomes:
* ```
* a ~ x
* a ~ y
* b ~ x
* b ~ y
* c ~ x
* c ~ y
* ```
*
* Also removes invalid word boundaries (middle "#" and duplicate "#").
*/
export declare function expand(ir: SquashedIR): ExpandedIR;
//# sourceMappingURL=expand.d.ts.map