using uCalcSoftware; var uc = new uCalc(); using (var t = new uCalc.Transformer()) { var text = "An apple, an apple pie, and an apple cider."; // Rule 1 (Lowest precedence for this anchor) t.FromTo("an apple", "[FRUIT]"); // Rule 2 (Higher precedence) t.FromTo("an apple pie", "[DESSERT]"); // The transformer will match "an apple pie" first because it was defined last. // For the remaining "an apple" occurrences, it will fall back to the first rule. Console.WriteLine(t.Transform(text)); };