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

simplenlg.features.Feature 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 which can be set up users of SimpleNLG. * 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") abstract public class Feature { /** * The constructor is never needed. */ private Feature() { // do nothing } /** *

* This feature determines if the adjectives should be reordered. Some * lexicons might support the positioning of adjectives and by default, this * order will be used. The user can override the ordering of adjectives by * setting this feature to false. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameadjectiveOrdering
Expected typeBoolean
Created bySet by the phrase factory on noun phrases. It can be overwritten by * the user.
Used byThe syntax processor will reorder adjectives in the premodifiers list * if this feature has a value of true.
Applies toNoun phrases only.
DefaultBoolean.TRUE
*/ public static final String ADJECTIVE_ORDERING = "adjective_ordering"; /** *

* This feature determines if the auxiliary verbs in a clause should be * aggregated. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameaggregateAuxiliary
Expected typeBoolean
Created byNeeds to be manually set by user.
Used byThe syntax processor will remove the auxiliary verbs from clauses * when this is set to true.
Applies toClauses only.
DefaultBoolean.FALSE
*/ public static final String AGGREGATE_AUXILIARY = "aggregate_auxiliary"; /** *

* The complementiser is the word that joins a subordinate clause to the * parent clause. For example, the two clauses: Timmy sang a song * and moved Elizabeth to tears can be joined with the * complementiser that to form: * Timmy sang a song that moved Elizabeth to * tears. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namecomplementiser
Expected typeCan take any NLGElement or a string. It is recommended * to use * InflectedWordElement as created by the PhraseFactory * method createWord(...).
Created byThe default is created by the PhraseFactory when creating * clauses.
Used byThe syntax processor uses the value of this feature when adding * complements to subordinate clauses.
Applies toClauses only.
Default"that" represented by an InflectedWordElement if a * lexicon is used, otherwise a StringElement.
*/ public static final String COMPLEMENTISER = "complementiser"; /** *

* This feature represents the word (or phrase) used for linking coordinated * phrases together. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameconjunction
Expected typeA String.
Created byCoordinatedPhraseElement creates this feature * automatically. The user can overwrite the value.
Used byThe syntax processor constructs the correct syntax for the * coordinated phrases.
Applies toCoordinatedPhraseElements.
Defaultnull
*/ public static final String CONJUNCTION = "conjunction"; /** *

* This feature represents the type of conjunction this coordination * represents. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameconjunctionType
Expected typeConjunctionType
Created byCoordinatedPhraseElement sets this value automatically. * It can be overwritten by the user.
Used byThe syntax processor constructs the correct syntax for the * coordinated phrases.
Applies toCoordinatedPhraseElements.
DefaultConjunctionType.COORDINATING
*/ public static final String CONJUNCTION_TYPE = "conjunction_type"; /** *

* An appositive is a type of postmodifying phrase which is quasi-synonymous * with, or a possible replacement of, the phrase it modifies. A typical * example occurs with NPs, e.g.: * his house, a large villa, is on the hill where the phrase * a large villa is an appositive postmodifier of * his house. Note that appositives are usually realised surrounded * by commas. Accordingly, this feature is primarily used by the orthography * processor to determine whether commas should be placed around a * postmodifying phrase. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameappositive
Expected typeboolean
Created byThe user.
Used byThe orthography processor to determine comma placement.
Applies toAny phrase which is a postmodifier of another phrase.
Defaultfalse or null
*/ public static final String APPOSITIVE = "appositive"; /** *

* This feature represents the cue phrase of a sentence. Cue phrases * sometimes appear at the start of sentences. In the following example, * however forms the cue phrase:
* However, John * played football instead. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namecuePhrase
Expected typeNLGElement
Created byCue phrases need to be specifically added by the user.
Used byThe syntax processor places the cue phrase at the start of a * sentence.
Applies toSentences.
Defaultnull
*/ public static final String CUE_PHRASE = "cue_phrase"; /** *

* This features determines if the phrase is elided. Elided phrases are * omitted from the final realisation. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameisElided
Expected typeBoolean
Created byThe feature needs to be set by the user.
Used byThe syntax processor removes elided phrases.
Applies toNoun phrases only.
DefaultBoolean.FALSE
*/ public static final String ELIDED = "elided"; /** *

* This feature dictates the form that a verb takes. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameform
Expected typeForm
Created byInitially created by the phrase factory when constructing verb * phrases. The user is free to set the value accordingly.
Used byThe syntax processor set the form on sentences to be the same as that * from the containing verb phrase. The syntax processor will also check a * verb's form for the addition of supporting words such as will * and to. The morphology processor uses the form to determine the * actual inflection of the verb to be used.
Applies toNouns, verbs noun phrases and verb phrases.
DefaultForm.NORMAL
*/ public static final String FORM = "form"; /** *

* This feature determines the type of interrogative (question) used for the * clause. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameinterrogativeType
Expected typeInterrogativeType
Created byThe user must set this value.
Used byThe syntax processor uses this feature to correctly structure * interrogative clauses.
Applies toClauses only.
Defaultnull.
*/ public static final String INTERROGATIVE_TYPE = "interrogative_type"; /** *

* This flag determines if the Adjective or Adverb should be inflected into * the comparative form. For example, the comparative form for * early is earlier, the comparative form of big * is bigger. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameisComparative
Expected typeBoolean
Created byThe user.
Used byThe morphology processor to correctly inflect the word.
Applies toAdjectives and adverbs only
DefaultBoolean.FALSE.
*/ public static final String IS_COMPARATIVE = "is_comparative"; /** *

* This flag determines if the Adjective or Adverb should be inflected into * the superlative form. For example, the comparative form for * early is earliest, the superlative form of big * is biggest. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameisSuperlative
Expected typeBoolean
Created byThe user.
Used byThe morphology processor to correctly inflect the word.
Applies toAdjectives and adverbs only
DefaultBoolean.FALSE.
*/ public static final String IS_SUPERLATIVE = "is_superlative"; /** *

* The modal represents the modal auxiliary verb that is used in a verb * phrase to express mood or tense. The English modals are: can, * may, must, ought, shall, * should, will and would. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namemodal
Expected typeString
Created byThe user.
Used byThe syntax processor adds modals into the structure.
Applies toClauses, coordinated phrases and verb phrases. In the case of clauses * and coordinated phrases, the modal is passed on to the underlying verb * phrase.
Defaultnull.
*/ public static final String MODAL = "modal"; /** *

* The flag determines if the corresponding verb phrase should be negated. * For example, negating the clause John kissed Mary results in the * clause John did not kiss Mary. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameisNegated
Expected typeBoolean
Created byThe user.
Used byThe syntax processor, which will correctly add in all necessary * auxiliary verbs.
Applies toClauses, coordinated phrases and verb phrases. In the case of clauses * and coordinated phrases, the modal is passed on to the underlying verb * phrase. Applying negation to a coordinated phase will negate all the * coordinates.
DefaultBoolean.FALSE.
*/ public static final String NEGATED = "negated"; /** *

* This feature is used to determine if the element is to be represented in * singular or plural form. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namenumber
Expected typeNumberAgreement
Created byThe phrase factory will create the number in certain cases, mostly in * dealing with pronouns. However, with supporting lexicons a word such as * dogs will be correctly identified as the plural form of * dog. The user can also set this feature.
Used byThe syntax processor ensures number agreement across phrases and * clauses, while the morphology processor uses the feature to pluralise * words.
Applies toClauses, coordinated phrases, noun phrases and verb phrases.
DefaultNumberAgreement.SINGULAR.
*/ public static final String NUMBER = "number"; /* *

This feature represents the pattern that a particular word follows * when being inflected. These can be regular, irregular, * regular double and in the case of nouns, Greco-Latin * regular.

* * * * * *
Feature namepattern
Expected typePattern
Created byThe user.
Used by The morphology * processor uses this feature to correctly inflect words following a simple * set of rules when no lexicon or user-defined form is supplied.
Applies to Adjectives, nouns and verbs.
Default null.
*/ // public static final String PATTERN = "pattern"; /** *

* This feature represents a particle used in conjunction with a verb. For * example, the verb phrases fall down and look up have * particles of down and up respectively. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameparticle
Expected typeString or NLGElement
Created byThe phrase factory will automatically check verbs to see if they * contain more than one word. In such a case, the first word becomes the * verb while additional words form the particle. The user can also * explicitly specify a particle
Used byThe syntax processor adds particles into the structure.
Applies toVerb phrases only.
Defaultnull.
*/ public static final String PARTICLE = "particle"; /** *

* This flag shows if the phrase or clause should be written in the passive * form. For example, the clause the cat ate the mouse can be * written in the passive form as the mouse was eaten by the cat. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameisPassive
Expected typeBoolean
Created byUser defined.
Used byThe syntax processor uses the passive feature to determine the * correct ordering of subjects and objects in a clause. It also adds in * additional auxiliary verbs to verb phrases, such as was in the * above example. The morphology processor will change pronouns of noun * phrases into passive form.
Applies toClauses, noun phrases and verb phrases.
DefaultBoolean.FALSE.
*/ public static final String PASSIVE = "passive"; /** *

* This flag shows if the phrase or clause should be written in the perfect * form. The perfect aspect is normally formed from the auxiliary verb * to have followed by the past participle of the main verb. For * example, the phrase the cat eats the mouse would have the * present perfect form of the cat has eaten the mouse. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameisPerfect
Expected typeBoolean
Created byUser defined.
Used byThe syntax processor adds in additional auxiliary verbs to verb * phrases, and alters the form of the main verb.
Applies toVerbs and verb phrases.
DefaultBoolean.FALSE.
*/ public static final String PERFECT = "perfect"; /** *

* This feature represents the first-person, second-person or third-person * nature of the phrase. This predominantly affects pronouns such as * I, you and they but some verbs will also be * modified depending on the person of reference. For example, kiss is used * as the present tense for first and second person (I kiss Mary * and you kiss Mary) while kisses is used for third person ( * he kisses Mary). *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameperson
Expected typePerson
Created byWill be set automatically by the phrase factory when personal * pronouns are identified. May also be set by the user.
Used byThe syntax processor does some basic checking on the person-nature of * phrases while the morphology processor will correctly inflect pronouns * and verbs.
Applies toClauses, coordinated phrases, noun phrases and verb phrases.
DefaultPerson.THIRD.
*/ public static final String PERSON = "person"; /** *

* This flag shows if the noun phrase should be written in the possessive * form. The possessive form of a noun is usually formed from the noun with * 's added to the end. For example, dog has a possessive form dog's * . Certain personal pronouns follow different rules, the possessive form * of I is mine, you is yours. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameisPossessive
Expected typeBoolean
Created byUser defined.
Used byThe syntax processor correctly defines the possessive on noun phrases * that contain more than one subject (we say John and Mary's not John's and Mary's * ). The morphology processor correctly inflects the possessive forms of * nouns and pronouns.
Applies toClauses, coordinated phrases and noun phrases.
DefaultBoolean.FALSE in most cases or for pronouns it is * dependent on the pronoun form used.
*/ public static final String POSSESSIVE = "possessive"; /** *

* This flag can be set for noun phrases where it is desirable to overwrite * the subject with a suitable pronoun. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameisPronominal
Expected typeBoolean
Created byUser defined.
Used byThe syntax processor will replace the subject of a noun phrase with a * suitable personal pronoun.
Applies toNoun phrases only.
DefaultBoolean.FALSE.
*/ public static final String PRONOMINAL = "pronominal"; /** *

* This flag determines if the verb phrase should be constructed in the * progressive form. For example, the progressive form of John kisses * Mary is John is kissing Mary. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameprogressive
Expected typeBoolean
Created bySet by the user.
Used byThe syntax processor adds in required auxiliary verbs when dealing * with the progressive form.
Applies toClauses, coordinated phrases and verb phrases only.
DefaultBoolean.FALSE.
*/ public static final String PROGRESSIVE = "progressive"; /** *

* This flag can be set when specifiers in a coordinated phrase should be * raised. For example, the coordinated phrase my cat and my dog * can have its specifiers raised becoming my cat and dog. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameraiseSpecifier
Expected typeBoolean
Created byUser defined.
Used byThe syntax processor to correctly add or remove specifiers.
Applies toCoordinated phrases only.
DefaultBoolean.FALSE
*/ public static final String RAISE_SPECIFIER = "raise_specifier"; /** *

* This flag is set when it is necessary to suppress the genitive when * dealing with gerund forms. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature namesuppressGenitive
Expected typeBoolean
Created byThe user.
Used byThe syntax processor will set subjects to be possessive when dealing * with the gerund form unless this flag is set.
Applies toClauses only.
DefaultBoolean.FALSE
*/ public static final String SUPPRESS_GENITIVE_IN_GERUND = "suppress_genitive_in_gerund"; /** *

* This flag determines if complementisers in subordinating clauses should * be suppressed. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nameisSuppressedComplementiser
Expected typeBoolean
Created byThe phrase factory sets some defaults but can be overridden by the * user.
Used byThe syntax processor will ignore suppressed complementisers on * subordinating clauses.
Applies toClauses and coordinated phrases.
DefaultBoolean.FALSE for clauses or Boolean.TRUE * on clauses when added to a coordinated phrase.
*/ public static final String SUPRESSED_COMPLEMENTISER = "suppressed_complementiser"; /** *

* This flag represents the tense or temporal quality of a verb. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
Feature nametense
Expected typeTense
Created byThe user.
Used byThe syntax processor ensures tense on phrases, clauses and * coordinated phrases is passed on to the underlying verb phrases. The * morphology processor uses the tese to correctly inflect verbs.
Applies toClauses, coordinated phrases and verb phrases.
DefaultTense.PRESENT.
*/ public static final String TENSE = "tense"; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy