コード例 #1
0
        private void SingleWordCommand(string command)
        {
            var direction = DirectionsHelper.GetDirectionCommand(command);

            _command.Verb            = direction.Verb;
            _command.Noun            = direction.Noun;
            _command.FullTextCommand = direction.FullTextCommand;

            if (_command.Verb == VerbCodes.NoCommand)
            {
                _command.Verb = Verbs.GetVerbForSynonym(command);
            }
        }
コード例 #2
0
        private bool ProcessVerbs(string word)
        {
            var verb = Verbs.GetVerbForSynonym(word);

            _parserStates = ParserStatesEnum.Noun;

            if (verb != VerbCodes.NoCommand)
            {
                _command.Verb = verb;
                return(true);
            }

            return(false);
        }
コード例 #3
0
        protected VerbCodes ProcessVerbs(string word, ParserStatesEnum nextState)
        {
            var verb = Verbs.GetVerbForSynonym(word);

            if (verb != VerbCodes.NoCommand)
            {
                _parserStates = nextState;
            }

            if (verb != VerbCodes.NoCommand)
            {
                return(verb);
            }

            return(VerbCodes.NoCommand);
        }