AIMA.Core.Logic.FOL.StandardizeApart.standardizeApart C# (CSharp) Метод

standardizeApart() публичный Метод

public standardizeApart ( Sentence aSentence, StandardizeApartIndexical standardizeApartIndexical ) : StandardizeApartResult
aSentence Sentence
standardizeApartIndexical StandardizeApartIndexical
Результат StandardizeApartResult
        public StandardizeApartResult standardizeApart(Sentence aSentence,
                StandardizeApartIndexical standardizeApartIndexical)
        {
            List<Variable> toRename = variableCollector
                    .collectAllVariables(aSentence);
            Dictionary<Variable, Term> renameSubstitution = new Dictionary<Variable, Term>();
            Dictionary<Variable, Term> reverseSubstitution = new Dictionary<Variable, Term>();

            foreach (Variable var in toRename)
            {
                Variable v = null;
                do
                {
                    v = new Variable(standardizeApartIndexical.getPrefix()
                            + standardizeApartIndexical.getNextIndex());
                    // Ensure the new variable name is not already
                    // accidentally used in the sentence
                } while (toRename.Contains(v));

                renameSubstitution.Add(var, v);
                reverseSubstitution.Add(v, var);
            }

            Sentence standardized = substVisitor.subst(renameSubstitution,
                    aSentence);

            return new StandardizeApartResult(aSentence, standardized,
                    renameSubstitution, reverseSubstitution);
        }

Same methods

StandardizeApart::standardizeApart ( Chain chain, StandardizeApartIndexical standardizeApartIndexical ) : Chain
StandardizeApart::standardizeApart ( Clause clause, StandardizeApartIndexical standardizeApartIndexical ) : Clause
StandardizeApart::standardizeApart ( List l1Literals, List l2Literals, StandardizeApartIndexical standardizeApartIndexical ) : Term>.Dictionary