#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto t = uc.NewTransformer(); // Priority Test: All start with "An" // 1. Defined first (lowest priority for same start) t.FromTo("An {item}", "Match1: {item}"); // 2. Defined second t.FromTo("An {item}.", "Match2: {item}"); // 3. Defined last (Highest priority for same start) t.FromTo("An orange.", "Match3: orange"); // Input text auto txt = "An orange. An apple. An elephant."; // "An orange." matches Rule 3 (Specific, defined last) // "An apple." fails Rule 3, matches Rule 2 (Ending in dot) // If input is "An elephant" (no dot), it falls back to Rule 1. cout << t.Transform("An orange.") << endl; // Match3: Orange cout << t.Transform("An apple.") << endl; // Match2: apple cout << t.Transform("An elephant") << endl; // Match1: elephant }