import { State, Rule } from "../../state-machine";
import { SAMPA } from "../../sampa";

export const zState = new State(
  "z",
  [
    "raz_riz"
  ],
  new Map([
    ["*", new Rule(null, SAMPA.FR.consonants["z"], 1)], // fallback [z]
    ["$", new Rule(null, SAMPA.FR.consonants["z"], 1)], // same as fallback

    ["raz_riz", new Rule({ type: "regExp", regExps: [
      { direction: "after", regExp: /\$/ },
      { direction: "before", regExp: /^r[ai]/ }
    ]}, SAMPA.specials["#"], 1)] // z silent in "raz" and "riz"
  ])
);
