Пример #1
0
        public void hear(string text)
        {
            response = "";
            reader.read(text);

            // first clause
            clsClause clause = reader.clauses[0];

            switch (clause.type)
            {
            case ClauseType.interogative:
            {
                // asking a question


                break;
            }

            case ClauseType.declaritive:
            {
                // making a statment
                foreach (clsPhrase subjectPhrase in clause.phrases)         // subject loop
                {
                    if (subjectPhrase.type == PhraseType.noun)
                    {
                        foreach (clsPhrase verbPhrase in clause.phrases)         // subject loop
                        {
                            if (verbPhrase.type == PhraseType.verb)
                            {
                                foreach (clsPhrase absolutePhrase in clause.phrases)        // subject loop
                                {
                                    if (absolutePhrase.type == PhraseType.absolute)         // absolute is just a place holder
                                    {
                                        memory.learn(subjectPhrase.firstPattern.firstConcept, verbPhrase.firstPattern.firstConcept, absolutePhrase.firstPattern.firstConcept);
                                    }
                                }
                            }
                        }
                    }
                }
                break;
            }

            case ClauseType.imperitive:
            {
                // giving direction


                break;
            }
            }
        }