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

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   // This example removes the single-quoted string token.
   uCalc::Transformer t;
   string txt = "This is a test, 'This is a test'";
   t.FromTo("{token:1}", "<{@Self}>");

   cout << "--- Before Removing Token ---" << endl;
   // Initially, 'This is a test' is treated as a single token.
   cout << t.Transform(txt).Text() << endl;

   // Now, find and remove the token definition for single-quoted strings.
   auto singleQuoteToken = t.Tokens().ByName("_token_string_singlequoted");
   t.Tokens().Remove(singleQuoteToken);

   // Re-run the transform. The text must be set again to be re-tokenized.
   t.Text(txt);
   cout << "" << endl;
   cout << "--- After Removing Token ---" << endl;
   // Now, the single quote is a generic token, as are the words inside it.
   cout << t.Transform().Text() << endl;
}