ilog.rules.vocabulary.verbalization

Class IlrDefaultVerbalizer

  • java.lang.Object
    • ilog.rules.vocabulary.verbalization.IlrDefaultVerbalizer
  • All Implemented Interfaces:
    IlrVerbalizer, java.lang.Cloneable


    public abstract class IlrDefaultVerbalizer
    extends java.lang.Object
    implements IlrVerbalizer
    Base implementation of IlrVerbalizer. You should subclass this abstract implementation as soon as you develop a new verbalizer for a new locale.
    • Constructor Detail

      • IlrDefaultVerbalizer

        public IlrDefaultVerbalizer()
        Builds a default verbalizer, using a default label builder.
    • Method Detail

      • getDefaultGender

        public IlrGender getDefaultGender()
        Description copied from interface: IlrVerbalizer
        Returns the default gender for the language of the verbalizer.
        Specified by:
        getDefaultGender in interface IlrVerbalizer
        Returns:
        The default gender.
      • getSupportedGenders

        public IlrGender[] getSupportedGenders()
        Description copied from interface: IlrVerbalizer
        Returns the list of genders used for the current locale.
        Specified by:
        getSupportedGenders in interface IlrVerbalizer
        Returns:
        An array of IlrGender constants or null if gender is not used for this locale.
      • clone

        public java.lang.Object clone()
        Description copied from interface: IlrVerbalizer
        Clones this IlrVerbalizer instance.
        Specified by:
        clone in interface IlrVerbalizer
        Overrides:
        clone in class java.lang.Object
        Returns:
        The clone of this instance.
      • makeArticleBuilder

        protected IlrArticleBuilder makeArticleBuilder()
        This method is a factory method to create an Article Builder related to this verbalizer
        Returns:
        a new article builder
      • makePluralBuilder

        protected IlrPluralBuilder makePluralBuilder()
        This method is a factory method to create a Plural Builder related to this verbalizer
        Returns:
        a new plural builder
      • makeTermBuilder

        protected IlrTermBuilder makeTermBuilder()
        This method is a factory method to create an Term Builder related to this verbalizer
        Returns:
        a new term builder
      • getGetterTemplate

        public java.lang.String getGetterTemplate(IlrSentence sentence,
                                         java.util.List synRoles)
        This method returns a phrase template corresponding to the read access of an attribute represented by the fact-type that holds this sentence. This template is used to generate a default navigation phrase.
        Parameters:
        sentence - the sentence to be assigned the template
        synRoles - the list of syntactic role for this sentence
        Returns:
        a phrase template
      • getSetterTemplate

        public java.lang.String getSetterTemplate(IlrSentence sentence,
                                         java.util.List synRoles)
        This method returns a phrase template corresponding to the write access of an attribute represented by the fact-type that holds this sentence. This template is used to generate a default action phrase.
        Parameters:
        sentence - the sentence to be assigned the template
        synRoles - the list of syntactic role for this sentence
        Returns:
        a phrase template
      • getClearerTemplate

        public java.lang.String getClearerTemplate(IlrSentence sentence,
                                          java.util.List synRoles)
        This method returns a phrase template corresponding to the reset of the value of an attribute represented by the fact-type that holds this sentence. This template is used to generate a default action phrase.
        Parameters:
        sentence - the sentence to be assigned the template
        synRoles - the list of syntactic role for this sentence
        Returns:
        a phrase template
      • getPredicateGetterTemplate

        public java.lang.String getPredicateGetterTemplate(IlrSentence sentence,
                                                  java.util.List synRoles)
        This method returns a phrase template corresponding to the test of an attribute represented by the fact-type that holds this sentence. This template is used to generate a default predicate phrase.
        Parameters:
        sentence - the sentence to be assigned the template
        synRoles - the list of syntactic role for this sentence
        Returns:
        a phrase template
      • getPredicateSetterTemplate

        public java.lang.String getPredicateSetterTemplate(IlrSentence sentence,
                                                  java.util.List synRoles)
        This method returns a phrase template to assign true or false to the attribute represented by the fact-type that holds this sentence. This template is used to generate a default action phrase.
        Parameters:
        sentence - the sentence to be assigned the template
        synRoles - the list of syntactic role for this sentence
        Returns:
        a phrase template
      • getOperatorTemplate

        public java.lang.String getOperatorTemplate(IlrSentence sentence,
                                           java.util.List synRoles)
        This method is not used.
      • getCollectionAddTemplate

        public java.lang.String getCollectionAddTemplate(IlrSentence sentence,
                                                java.util.List synRoles)
        This method returns a phrase template corresponding to the addition of an element to a Collection. This template is used to generate a default phrase that add an element. It is an action phrase related to the fact-type that represents a Collection attribute.
        Parameters:
        sentence - the sentence to be assigned the template
        synRoles - the list of syntactic role for this sentence
        Returns:
        a phrase template
      • getCollectionRemoveTemplate

        public java.lang.String getCollectionRemoveTemplate(IlrSentence sentence,
                                                   java.util.List synRoles)
        This method returns a phrase template corresponding to the removal of an element from a Collection. This template is used to generate a default phrase that remove an element. It is an action phrase related to the fact-type that represents a Collection attribute.
        Parameters:
        sentence - the sentence to be assigned the template
        synRoles - the list of syntactic role for this sentence
        Returns:
        a phrase template
      • getCollectionClearTemplate

        public java.lang.String getCollectionClearTemplate(IlrSentence sentence,
                                                  java.util.List synRoles)
        This method returns a phrase template corresponding to the clear operation of a Collection. This template is used to generate a default phrase that clear a collection. It is an action phrase related to the fact-type that represents a Collection attribute.
        Parameters:
        sentence - the sentence to be assigned the template
        synRoles - the list of syntactic role for this sentence
        Returns:
        a phrase template
      • getConstructorTemplate

        public java.lang.String getConstructorTemplate(IlrSentence sentence,
                                              java.util.List synRoles)
        This method returns a phrase template corresponding to a constructor phrase used to create an instance of a given concept.
        Parameters:
        sentence - the sentence to be assigned the template
        synRoles - the list of syntactic role for this sentence
        Returns:
        a phrase template
      • generateTemplate

        public java.lang.String generateTemplate(IlrSentence sentence,
                                        java.util.List synRoles)
        Description copied from interface: IlrVerbalizer
        Produces the default template for sentence, according to its category.
        Specified by:
        generateTemplate in interface IlrVerbalizer
        Parameters:
        sentence - The sentence for which the template is produced.
        synRoles - The list of the syntactic roles of sentence that should appear in the template as placeholders.
        Returns:
        The produced sentence template.

© Copyright IBM Corp. 1987, 2017