Package grammar.input.stdin.Command

Examples of grammar.input.stdin.Command.ModelVerbCommand


        (words[1].equals("verbs") || words[1].equals("tenses"));
    }

    public Command interpret(Language language, Action action, String[] words, String[] wordsWithConj) {
      if (words[1].equalsIgnoreCase("verbs"))
        return new ModelVerbCommand(action, Arrays.asList(ModelVerb.values(language)), false, true);
      else
        return new TenseCommand(action, Arrays.asList(Tense.values(language)));
    }
View Full Code Here


        includeSelf = false;
      }
      for (String word : words) {
        modelVerbs.add(ModelVerb.valueOf(language, word));
      }
      return new ModelVerbCommand(action, modelVerbs, includeInherited, includeSelf);
    }
View Full Code Here

  }

  @Override
  public boolean processCommand(Command command, Action action) {
    if (command instanceof ModelVerbCommand) {
      ModelVerbCommand modelVerbCommand = (ModelVerbCommand) command;
      List<ModelVerb> modelVerbs = modelVerbCommand.getModelVerbs();
      Set<ConjugatedVerb> conjugatedVerbs = new HashSet<ConjugatedVerb>();
      for (ModelVerb modelVerb : modelVerbs) {
        conjugatedVerbs.addAll(modelVerb.getConjugatedVerbs(
            modelVerbCommand.includeInherited(), modelVerbCommand.includeSelf()));
      }
      updateScope(verbsInScope, conjugatedVerbs, action);
      printScope(new TreeSet<ConjugatedVerb>(verbsInScope), "Verbs");
      return true;
    }
View Full Code Here

TOP

Related Classes of grammar.input.stdin.Command.ModelVerbCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.