/** * Performs the realisation for YES/NO types of questions. This may involve * adding an optional <em>do</em> auxiliary verb to the beginning of the * clause. The method also determines if there is a subject that will split * the verb group of the clause. For example, the clause * <em>the man <b>should give</b> the woman the flower</em> has the verb * group indicated in <b>bold</b>. The phrase is rearranged as yes/no * question as * <em><b>should</b> the man <b>give</b> the woman the flower</em> with the * subject <em>the man</em> splitting the verb group. * * * @param phrase * the <code>PhraseElement</code> representing this clause. * @param parent * the parent <code>SyntaxProcessor</code> that will do the * realisation of the complementiser. * @param realisedElement * the current realisation of the clause. * @param phraseFactory * the phrase factory to be used. * @param verbElement * the <code>NLGElement</code> representing the verb phrase for * this clause. * @param subjects * the <code>List</code> of subjects in the clause. * @return an <code>NLGElement</code> representing a subject that should * split the verb */ private static NLGElement realiseYesNo(PhraseElement phrase, SyntaxProcessor parent, NLGElement verbElement, NLGFactory phraseFactory, ListElement realisedElement) { NLGElement splitVerb = null; if (!(verbElement is VPPhraseSpec && VerbPhraseHelper.isCopular(((VPPhraseSpec)verbElement).getVerb())) && !phrase.getFeatureAsBoolean(Feature.PROGRESSIVE) && !phrase.hasFeature(Feature.MODAL) && !Tense.FUTURE.Equals(phrase.getFeature(Feature.TENSE)) && !phrase.getFeatureAsBoolean(Feature.NEGATED) && !phrase.getFeatureAsBoolean(Feature.PASSIVE)) { addDoAuxiliary(phrase, parent, phraseFactory, realisedElement); } else { splitVerb = realiseSubjects(phrase, parent); } return(splitVerb); }
/** * Controls the realisation of <em>wh</em> object questions. * * @param keyword * the wh word * @param phrase * the <code>PhraseElement</code> representing this clause. * @param parent * the parent <code>SyntaxProcessor</code> that will do the * realisation of the complementiser. * @param realisedElement * the current realisation of the clause. * @param phraseFactory * the phrase factory to be used. * @param subjects * the <code>List</code> of subjects in the clause. * @return an <code>NLGElement</code> representing a subject that should * split the verb */ private static NLGElement realiseObjectWHInterrogative(string keyword, PhraseElement phrase, SyntaxProcessor parent, ListElement realisedElement, NLGFactory phraseFactory) { NLGElement splitVerb = null; realiseInterrogativeKeyWord(keyword, new LexicalCategory(LexicalCategory.LexicalCategoryEnum.PRONOUN), parent, realisedElement, phraseFactory); //$NON-NLS-1$ // if (!Tense.FUTURE.equals(phrase.getFeature(Feature.TENSE)) && !copular) { if (!hasAuxiliary(phrase) && !VerbPhraseHelper.isCopular(phrase)) { addDoAuxiliary(phrase, parent, phraseFactory, realisedElement); } else if (!phrase.getFeatureAsBoolean(Feature.PASSIVE)) { splitVerb = realiseSubjects(phrase, parent); } return(splitVerb); }