Parsing boolean values that might be represented differently.

ID: 237

				
					using uCalcSoftware;

var uc = new uCalc();
var t = uc.NewTransformer();
// Normalize "True/Yes/On" to "TRUE" and "False/No/Off" to "FALSE"
t.FromTo("{ True | Yes | On }", "TRUE");
t.FromTo("{ False | No | Off }", "FALSE");

Console.WriteLine(t.Transform("System is On"));    // Output: System is TRUE
Console.WriteLine(t.Transform("Power is False"));  // Output: Power is FALSE
				
			
System is TRUE
Power is FALSE
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   auto t = uc.NewTransformer();
   // Normalize "True/Yes/On" to "TRUE" and "False/No/Off" to "FALSE"
   t.FromTo("{ True | Yes | On }", "TRUE");
   t.FromTo("{ False | No | Off }", "FALSE");

   cout << t.Transform("System is On") << endl;    // Output: System is TRUE
   cout << t.Transform("Power is False") << endl;  // Output: Power is FALSE
}
				
			
System is TRUE
Power is FALSE
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t = uc.NewTransformer()
      '// Normalize "True/Yes/On" to "TRUE" and "False/No/Off" to "FALSE"
      t.FromTo("{ True | Yes | On }", "TRUE")
      t.FromTo("{ False | No | Off }", "FALSE")
      
      Console.WriteLine(t.Transform("System is On"))    '// Output: System is TRUE
      Console.WriteLine(t.Transform("Power is False"))  '// Output: Power is FALSE
   End Sub
End Module
				
			
System is TRUE
Power is FALSE