Exemplo n.º 1
0
        private HandleUnit HandleFile(RuleFileStructure currentFile, string ruleDir)
        {
            var    predicateDic = currentFile.PredicateSymbolDic;
            string qaPair       = currentFile.FileName.Replace(ruleDir, Variable.NullString);

            qaPair = qaPair.Replace(Variable.TextSuffix, Variable.NullString);
            return(new HandleUnit(GetRuleGraphDic(currentFile), predicateDic, currentFile.FileName));
        }
Exemplo n.º 2
0
        private Dictionary <int, List <List <TriplePresentation> > > GetRuleGraphDic(RuleFileStructure currentFile)
        {
            Dictionary <int, List <List <TriplePresentation> > > result = new Dictionary <int, List <List <TriplePresentation> > >();

            foreach (var ruleGraph in currentFile.RuleSet)
            {
                if (result.ContainsKey(ruleGraph.Count))
                {
                    result[ruleGraph.Count].Add(ruleGraph);
                }
                else
                {
                    result[ruleGraph.Count] = new List <List <TriplePresentation> > {
                        ruleGraph
                    }
                }
            }
            ;

            return(result.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value));
        }