#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   uCalc::Transformer t;
   t.Text("The apple is an apple.");

   // Overlapping patterns. The longer one is defined last, so it gets precedence.
   t.Pattern("apple");
   t.Pattern("an apple");

   cout << "--- First Find ---" << endl;
   t.Find();
   // The first 'apple' matches the first rule.
   // The 'an apple' matches the second (higher precedence) rule.
   cout << t.Matches().Text() << endl;

   // Re-running find should produce the exact same result
   cout << "--- Second Find (no change) ---" << endl;
   t.Find();
   cout << t.Matches().Text() << endl;
}