All Downloads are FREE. Search and download functionalities are using the official Maven repository.

simplenlg.features.InternalFeature Maven / Gradle / Ivy

There is a newer version: 4.5.0
Show newest version
/*
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * The Original Code is "Simplenlg".
 *
 * The Initial Developer of the Original Code is Ehud Reiter, Albert Gatt and Dave Westwater.
 * Portions created by Ehud Reiter, Albert Gatt and Dave Westwater are Copyright (C) 2010-11 The University of Aberdeen. All Rights Reserved.
 *
 * Contributor(s): Ehud Reiter, Albert Gatt, Dave Wewstwater, Roman Kutlak, Margaret Mitchell.
 */
package simplenlg.features;

/**
 * 

* This class defines a list of features internally used within the SimpleNLG * system. * Note that there are three feature classes in SimpleNLG. *

    *
  • Feature: features typically set up developers invoking SimpleNLG *
  • LexicalFeature: features typically set up the SimpleNLG lexicon *
  • InternalFeature: features typically used internally by SimpleNLG *
* * Elements in the system can, in theory, take any kind of feature. Some * features will only be expected by certain processors, however. * Developers can define their own features but should * choose names that do not conflict with those presented here. *

*

* The details for each feature are supplied in a table. The entries are: *

* * * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameThis is the name that will appear in the element's feature list as * produced by the toString() method or by calling * getAllFeatureNames
Expected typeAs features are represented as a Map connecting a * String and an Object then, in theory, a feature can * take any object as a value. This table entry defines the type that the * SimpleNLG system expects.
Created byDefines where the feature is created. In addition, all features can be * added specifically by users
Used byDefines which processors use the feature.
Applies toDefines which structural, syntactical or lexical elements this feature is * applied to.
DefaultAny default values attributed to the feature are given here.
* * @author E. Reiter and D. Westwater, University of Aberdeen. * @version 4.0 * */ @SuppressWarnings("nls") public abstract class InternalFeature { /** *

* This feature determines if the element is an acronym. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameisAcronym
Expected typeBoolean
Created byThe phrase factory creates the feature on noun phrases. The syntax * processor creates the feature on nouns.
Used byNo processors currently use this feature. It is expected to be used * by the orthography processor.
Applies toNouns and noun phrases.
DefaultBoolean.FALSE
*/ public static final String ACRONYM = "acronym"; /** *

* This feature is used to reference the base word element as created by the * lexicon. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namebaseWord
Expected typeWordElement
Created byCurrently initially set by the syntax processor but should be done by * the phrase factory with the syntax and morphology processors only setting * this if the it doesn't already exist.
Used byThe syntax processor refers to the base word when determining * adjective ordering. The morphology processor also needs the base word for * performing morphology on the lexical items.
Applies toInflectedWordElements of any category.
Defaultnull
*/ public static final String BASE_WORD = "base_word"; /** *

* This feature determines the status of a sentence. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameclauseStatus
Expected typeClauseStatus
Created byThe phrase factory creates this feature when creating sentences.
Used byThe syntax processor refers to the clause status when deciding * whether to add the complementiser or not. Only subordinate clauses will * have the complementiser added.
Applies toClauses.
DefaultClauseStatus.MATRIX
*/ public static final String CLAUSE_STATUS = "clause_status"; /** *

* This feature refers to the list of complements for the phrase. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namecomplements
Expected typeList<NLGElement>
Created byThe phrase factory has the functionality for taking complements when * creating prepositional phrases or sentences. Complements can also be * added to other types of phrases by the user.
Used byThe syntax processor realises the complements in the correct * syntactical order when realising phrases.
Applies toPhrases of any type.
DefaultClauseStatus.MATRIX
*/ public static final String COMPLEMENTS = "complements"; /** *

* This feature refers to the list of components in a * ListElement. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namecomponents
Expected typeList<NLGElements>
Created byThe syntax processor creates ListElements with * components. This is done as part of the normal realisation of phrases * into a list of words. Components can be added by the user.
Used byThe syntax and morphology processors both access the components * feature when realising ListElements.
Applies toListElements.
Defaultnull
*/ public static final String COMPONENTS = "components"; /** *

* This feature is the list of coordinated phrases in a * CoordinatedPhraseElement. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namecoordinates
Expected typeList<NLGElements>
Created byCoordinatedPhraseElement has convenience methods for * adding the coordinate phrases to a particular.
Used byThe syntax processors creates the structure of coordinated phrases * and adds in the conjoining word where appropriate.
Applies toCoordinatedPhraseElementss only.
Defaultnull
*/ public static final String COORDINATES = "coordinates"; /** *

* This feature defines the role each element plays in the structure of the * text. For example, the phrase John played football has * John as the subject, play as the base verb and * football as the complement. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namediscourseFunction
Expected typeDiscourseFunction
Created byThe syntax processor defines the function of each word as it parses * phrases.
Used byThe morphology processor uses the function when checking pronoun * inflections.
Applies toAny NLGElement but typically words.
Defaultnull
*/ public static final String DISCOURSE_FUNCTION = "discourse_function"; public static final String NON_MORPH = "non_morph"; /** *

* This feature tracks any front modifiers in sentences. Front modifiers are * placed after the cue phrase but before the subject. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namefrontModifiers
Expected typeNLGElement
Created byFront modifiers need to be manually added by users.
Used byThe syntax processor realises front modifiers in their correct place * within the structure of the sentence.
Applies toSentences.
Defaultnull
*/ public static final String FRONT_MODIFIERS = "front_modifiers"; /** *

* This feature points to the head element in a phrase. The head element is * deemed to be the subject in a noun phrase, the verb in a verb phrase, the * adjective in an adjective phrase, the adverb in an adverb phrase or the * preposition in a preposition phrase. The PhraseElement has a * convenience method for getting and setting the head feature. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namephraseHead
Expected typeNLGElement
Created byThe phrase factory sets an appropriate head when constructing * phrases.
Used byThe syntax processor uses the head element when constructing the * correct syntax for the text. The head element is also important for * determining the main verb in a verb group.
Applies toPhrases.
DefaultThe value is set to an appropriate element by the phrase factory.
*/ public static final String HEAD = "head"; /** *

* This flag is used to determine if the modal should be included in the * verb phrase. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameignoreModal
Expected typeBoolean
Created byThe syntax processor sets this flag when dealing with interrogatives. *
Used byThe syntax processor will ignore modals on certain interrogatives.
Applies toCoordinated phrases and verb phrases.
DefaultBoolean.FALSE
*/ public static final String IGNORE_MODAL = "ignore_modal"; /** *

* This flag determines if the sentence is interrogative or not. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameisInterrogative
Expected typeBoolean
Created byThe syntax processor sets this feature on sentences if a contained * phrase is interrogative.
Used byOrthography processor uses this to add a question mark instead of a * period at the end of interrogative sentences.
Applies toSentences only.
DefaultBoolean.FALSE.
*/ public static final String INTERROGATIVE = "interrogative"; /** *

* This feature represents the list of post-modifier elements. * Post-modifiers are added to the end of phrases and coordinated phrases. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namepostModifiers
Expected typeList<NLGElement>
Created byThe user specifies the post-modifiers. Convenience methods are added. *
Used byThe syntax processor correctly adds the post-modifiers into the * structure of the text.
Applies toClauses, phrases and coordinated phrases.
Defaultnull.
*/ public static final String POSTMODIFIERS = "postmodifiers"; /** *

* This feature represents the list of premodifier elements. Premodifiers * are added to phrases before the head of the phrase, and to coordinated * phrases before the coordinates. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namepreModifiers
Expected typeList<NLGElement>
Created byThe user specifies the premodifiers. Convenience methods are added.
Used byThe syntax processor correctly adds the premodifiers into the * structure of the text.
Applies toClauses, phrases and coordinated phrases.
Defaultnull.
*/ public static final String PREMODIFIERS = "premodifiers"; /** *

* This flag is used to define whether a noun phrase has had its specifier * raised. It is used in conjunction with the RAISE_SECIFIER * feature. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameisRaised
Expected typeBoolean
Created byThe syntax processor sets this flag on noun phrases when processing * coordinated phrases whose specifier has been raised.
Used byThe syntax processor to correctly add or remove specifiers.
Applies toNoun phrases only.
DefaultBoolean.FALSE
*/ public static final String RAISED = "raised"; /** *

* This flag determines if auxiliary verbs should be realised in coordinated * verb phrases. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameisRealiseAuxiliary
Expected typeBoolean
Created byThe syntax processor sets this flag on verb phrases when processing * coordinated phrases which has had the AGGREGATE_AUXILIARY * feature set.
Used byThe syntax processor to correctly add or ignore auxiliary verbs in * verb phrases.
Applies toVerb phrases only.
DefaultBoolean.FALSE
*/ public static final String REALISE_AUXILIARY = "realise_auxiliary"; /** *

* This feature contains the specifier for a noun phrase. For example * the and my. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namespecifier
Expected typeNLGElement or String
Created bySpecifiers are added to noun phrases when they are constructed by the * phrase factory.
Used byThe syntax processor places specifiers before the main subject in a * noun phrase.
Applies toNoun phrases only.
Defaultnull
*/ public static final String SPECIFIER = "specifier"; /** *

* This feature represents the list of subjects in a clause. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namesubjects
Expected typeList<NLGElement>
Created bySubjects are added to clauses through the phrase factory.
Used byThe syntax processor realises all subjects in the correct place.
Applies toClauses only.
Defaultnull.
*/ public static final String SUBJECTS = "subjects"; /** *

* This feature represents the verb phrase in a clause. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameverbPhrase
Expected typeNLGElement, typically a PhraseElement, but * can also be a String
Created byThe verb phrase is added to clauses through the phrase factory.
Used byThe syntax processor realises the verb phrase in the correct place.
Applies toClauses only.
Defaultnull.
*/ public static final String VERB_PHRASE = "verb_phrase"; /** * The constructor is never needed. */ private InternalFeature() { // do nothing } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy