Exemple #1
0
        // all fields of parameters have to be initialized except compoundId
        internal Compound createCompound(Compound.MakeParameters parameters)
        {
            parameters.compoundId = compoundIdCounter;
            Compound resultCompound = Compound.make(parameters);

            compoundIdCounter++;



            return(resultCompound);
        }
Exemple #2
0
        public CompoundIndex makeInheritance(string a, string b)
        {
            int termOrCompoundTermOrVariableRefererIdOfA, termOrCompoundTermOrVariableRefererIdOfB;

            TermTupleIndex termTupleIndexOfA = compoundAndTermContext.returnIndexOfTermTupleForHumanReadableTermNameOrCreate(a, out termOrCompoundTermOrVariableRefererIdOfA);
            TermTupleIndex termTupleIndexOfB = compoundAndTermContext.returnIndexOfTermTupleForHumanReadableTermNameOrCreate(b, out termOrCompoundTermOrVariableRefererIdOfB);

            var compoundReferers = new TermOrCompoundTermOrVariableReferer[] {
                compoundAndTermContext.accessTermTupleByIndex(termTupleIndexOfA).refererOrIntervals[0].referer,
                compoundAndTermContext.accessTermTupleByIndex(termTupleIndexOfB).refererOrIntervals[0].referer,
            };

            TermTupleIndex termTupleIndex;

            if (compoundAndTermContext.existTermTuple(compoundReferers))
            {
                termTupleIndex = compoundAndTermContext.getTermTupleIndexByReferers(compoundReferers);
            }
            else
            {
                termTupleIndex = compoundAndTermContext.addTermTupleByReferers(compoundReferers);
            }

            // create compound
            Compound.MakeParameters makeParameters = new Compound.MakeParameters();
            makeParameters.flagsOfCopula   = FlagsOfCopula.makeInheritance();
            makeParameters.termComplexity  = 3;
            makeParameters.termTupleIndex  = termTupleIndex;
            makeParameters.thisTermReferer = TermOrCompoundTermOrVariableReferer.makeNonatomic(compoundAndTermContext.TermOrCompoundTermOrVariableRefererCounter);
            compoundAndTermContext.TermOrCompoundTermOrVariableRefererCounter++;


            Compound      compound      = compoundAndTermContext.createCompound(makeParameters);
            CompoundIndex compoundIndex = compoundAndTermContext.addCompound(compound);


            return(compoundIndex);
        }