ilog.rules.vocabulary.verbalization

Class IlrVerbalizationContext

  • java.lang.Object
    • ilog.rules.vocabulary.verbalization.IlrVerbalizationContext
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable


    public class IlrVerbalizationContext
    extends java.lang.Object
    implements java.lang.Cloneable, java.io.Serializable
    IlrVerbalizationContext provides a context while verbalizing a vocabulary element. It is used to provide information such as which article to use, and if the verbalization should produce a plural form.
    See Also:
    Serialized Form
    • Constructor Detail

      • IlrVerbalizationContext

        public IlrVerbalizationContext(IlrVocabulary vocabulary)
        Builds a verbalization context using a specific vocabulary.
        Parameters:
        vocabulary - The vocabulary.
    • Method Detail

      • getNoArticleContext

        public static IlrVerbalizationContext getNoArticleContext(IlrVocabulary vocabulary)
        Returns a verbalization context that has no article.
        Parameters:
        vocabulary - The vocabulary attached to the verbalization context.
        Returns:
        A verbalization context.
      • getDefiniteArticleContext

        public static IlrVerbalizationContext getDefiniteArticleContext(IlrVocabulary vocabulary)
        Returns a verbalization context that uses a definite article.
        Parameters:
        vocabulary - The vocabulary attached to the verbalization context.
        Returns:
        A verbalization context.
      • getIndefiniteArticleContext

        public static IlrVerbalizationContext getIndefiniteArticleContext(IlrVocabulary vocabulary)
        Returns a verbalization context that uses a indefinite article.
        Parameters:
        vocabulary - The vocabulary attached to the verbalization context.
        Returns:
        A verbalization context.
      • getIndefinitePluralArticleContext

        public static IlrVerbalizationContext getIndefinitePluralArticleContext(IlrVocabulary vocabulary)
        Returns a verbalization context that uses an indefinite article.
        Parameters:
        vocabulary - The vocabulary attached to the verbalization context.
        Returns:
        A verbalization context.
      • getDefinitePluralArticleContext

        public static IlrVerbalizationContext getDefinitePluralArticleContext(IlrVocabulary vocabulary)
        Returns a verbalization context that uses a plural article.
        Parameters:
        vocabulary - The vocabulary attached to the verbalization context.
        Returns:
        A verbalization context.
      • getVocabulary

        public IlrVocabulary getVocabulary()
        Returns the vocabulary.
        Returns:
        The vocabulary.
      • getArticle

        public IlrArticle getArticle()
        Returns the article of this verbalization context.
        Returns:
        The article.
      • setArticle

        public IlrVerbalizationContext setArticle(IlrArticle article)
        Sets the article.
        Parameters:
        article - The new article.
        Returns:
        This verbalization context with the new article.
      • isPlural

        public boolean isPlural()
        Checks if this verbalization context is plural.
        Returns:
        If a plural should be produced, true is returned.
      • setPlural

        public IlrVerbalizationContext setPlural(boolean plural)
        Sets if the verbalization context is plural.
        Parameters:
        plural - Set to true to indicate that this context is plural.
      • isPartitive

        public boolean isPartitive()
        Checks if this context is in partitive form.
        Returns:
        If the context is in the partitive form, true is returned.
      • setPartitive

        public IlrVerbalizationContext setPartitive(boolean partitive)
        Sets if this context is in the partitive form.
        Parameters:
        partitive - Set to true to indicate that this context is in partitive form.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException
      • toString

        public java.lang.String toString()
        Returns the string representation of this verbalization context.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation of this verbalization context

© Copyright IBM Corp. 1987, 2017