Package grammar.model.verbs

Examples of grammar.model.verbs.Tense


      else {
        if (targetContext && inheritTense) {
          return;
        }
        else {
          Tense t = Tense.valueOf(getLanguage(), parsedStringAsConstant);
         
          if (targetContext)
            targetTense = t;
          else
            affectedTenses.add(t);
        }
      }
    }
    else if (parseMode == ParseMode.RULE && !qName.equals("parent")) {
      disableParsing();
      for (Tense affectedTense : affectedTenses) {
        List<FormCategory> forms = affectedPronouns;
        if (allFormsContext) {
          Map<FormCategory, Map<Segment, Tense>> m = refTenseMap.get(affectedTense);
          Set<FormCategory> s;
          if (m == null) {
            s = new HashSet<FormCategory>(Arrays.asList(parents.get(0).getForms(affectedTense)));
          }
          else
            s = m.keySet();
          forms = new ArrayList<FormCategory>(s);
        }
       
        for (FormCategory affectedPronoun : forms) {
          if (formContext || auxiliaryFormContext) {
            if (affectedSegments.size() == 0)
              affectedSegments.addAll(Arrays.asList(Segment.values()));
           
            FormCategory targetPronoun;
            if (inheritForm)
              targetPronoun = null; // no rule; refer to parent
            else if (parsedStringAsConstant.equals(""))
              targetPronoun = affectedPronoun;
            else if (targetTense != null && targetTense.getMood().isPersonal())
              targetPronoun = PersonalPronounCategory.valueOf(parsedStringAsConstant);
            else
              targetPronoun = new ImpersonalFormCategory(parsedStringAsConstant);
           
            Tense targetTense2;
            if (inheritTense)
              targetTense2 = null; // no rule; refer to parent
            else if (targetTense == null)
              targetTense2 = affectedTense;
            else
View Full Code Here


  public void endDocument() {
    if (name == null)
      throw new IllegalStateException("No name defined for this tense!");
    if (mood == null)
      throw new IllegalStateException("No mood defined for this tense!");
    tense = new Tense(getLanguage(), name, mood, sequence, classifications);
    for (TenseTag tc : classifications)
      tc.addMember(tense);
  }
View Full Code Here

    private final ModelVerb modelVerb;
    private final FormCategory formCategory;
    private final String correctAnswer;
   
    private FormQuestion() {
      Tense tense;
      ConjugatedVerb conjugatedVerb;
      FormCategory[] forms;
      while (true) {
        Tense[] tenses = tensesInScope.toArray(new Tense[]{});
        ConjugatedVerb[] conjugatedVerbs = verbsInScope.toArray(new ConjugatedVerb[]{});
View Full Code Here

        else if (response.startsWith("conjugate") && response.contains("of")) {
          response = response.substring("conjugate the ".length()).replace(" tense", "");
          String tense = response.substring(0, response.indexOf(" of"));
          String infinitive = response.substring(response.lastIndexOf(' ')+1);
 
          Tense t = Tense.valueOf(language, tense);
          conj.conjugate(infinitive, language, false, Arrays.asList(new Tense[] {t}));
        }
        else if (response.startsWith("conjugate")) {
          //System.err.println("Main.main:"+new Date());
          conj.conjugate(response.substring("conjugate ".length()), language, false);
View Full Code Here

TOP

Related Classes of grammar.model.verbs.Tense

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.