Examples of Tense


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

Examples of grammar.model.verbs.Tense

  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

Examples of grammar.model.verbs.Tense

    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

Examples of grammar.model.verbs.Tense

        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

Examples of simplenlg.features.Tense

    String realised = null;
    Object numberValue = element.getFeature(Feature.NUMBER);
    Object personValue = element.getFeature(Feature.PERSON);
    Object tense = element.getFeature(Feature.TENSE);
    Tense tenseValue;

    // AG: change to avoid deprecated getTense
    // if tense value is Tense, cast it, else default to present
    if (tense instanceof Tense) {
      tenseValue = (Tense) tense;
View Full Code Here

Examples of simplenlg.features.Tense

  static final private Stack<NLGElement> createVerbGroup(
      SyntaxProcessor parent, PhraseElement phrase) {

    String actualModal = null;
    Object formValue = phrase.getFeature(Feature.FORM);
    Tense tenseValue = phrase.getTense();
    String modal = phrase.getFeatureAsString(Feature.MODAL);
    boolean modalPast = false;
    Stack<NLGElement> vgComponents = new Stack<NLGElement>();
    boolean interrogative = phrase.hasFeature(Feature.INTERROGATIVE_TYPE);
View Full Code Here

Examples of simplenlg.features.Tense

   *
   * @return the <code>Tense</code> of this element.
   */
  @Deprecated
  public Tense getTense() {
    Tense tense = Tense.PRESENT;
    Object tenseValue = getFeature(Feature.TENSE);
    if (tenseValue instanceof Tense) {
      tense = (Tense) tenseValue;
    }
    return tense;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.