コード例 #1
0
 public void T3ParseJson()
 {
     testRule = LinguisticRule.fromJson(TestJsonRule);
     Assert.AreEqual(
         TestOperator,
         testRule.fOperator);
     Assert.AreEqual(
         TestImplication,
         testRule.implicationM);
     Assert.AreEqual(
         testActualRule,
         testRule.rule);
     Debug.Log("[Test Rule]\n" + testRule.encodeLinguisticJson().Print(true));
 }
コード例 #2
0
 public void T4LinguisticEncode()
 {
     testRule = LinguisticRule.fromJson(TestJsonRule);
     Assert.AreEqual(
         testRuleValue,
         testRule.encodeLinguisticJson().GetField("Value").str
         );
     Assert.AreEqual(
         TestImplication,
         FuzzyImplication.TryParse(
             testRule.encodeLinguisticJson().
             GetField("Implication").str)
         );
     Assert.AreEqual(
         FuzzyOperator.nameOf(TestOperator),
         testRule.encodeLinguisticJson().
         GetField("Operator").str
         );
     Assert.AreEqual(
         testActualRule,
         testRule.encodeLinguisticJson().GetField("Rule").str
         );
 }