ilog.rules.vocabulary.verbalization

Class IlrVerbalizerHelper

  • java.lang.Object
    • ilog.rules.vocabulary.verbalization.IlrVerbalizerHelper


  • public final class IlrVerbalizerHelper
    extends java.lang.Object
    This class provides many facilities for verbalizing vocabulary elements.
    • Method Detail

      • verbalize

        public static java.lang.String verbalize(IlrVerbalizable verbalizable,
                                 IlrVerbalizationContext context,
                                 IlrVocabulary vocabulary)
        Produces the verbalization of the specified verbalizable using the provided verbalization context.
        Parameters:
        verbalizable - The verbalizable to verbalize.
        context - The verbalization context.
        vocabulary - The vocabulary to which this verbalizable is associated
      • verbalize

        public static java.lang.String verbalize(IlrConcept concept,
                                 IlrVocabulary vocabulary)
        Produces a simple verbalization of the specified concept.
        Parameters:
        concept - The concept to verbalize.
        vocabulary - The vocabulary.
        Returns:
        The verbalization of concept.
      • verbalize

        public static java.lang.String verbalize(IlrConceptInstance instance,
                                 IlrVocabulary vocabulary)
        Produces a simple verbalization of the specified instance.
        Parameters:
        instance - The concept instance to verbalize.
        vocabulary - The vocabulary.
        Returns:
        The verbalization of instance.
      • verbalize

        public static java.lang.String verbalize(IlrConceptInstance instance,
                                 IlrVerbalizationContext context)
        Computes the verbalization for the specified instance using the provided verbalization context.
        Parameters:
        instance - The concept instance to verbalize.
        context - The verbalization context.
      • verbalize

        public static java.lang.String verbalize(IlrConcept concept,
                                 IlrVerbalizationContext context)
        Produces the verbalization of the specified concept using the provided verbalization context.
        Parameters:
        concept - The concept to verbalize.
        context - The verbalization context.
      • verbalize

        public static java.lang.String verbalize(IlrRole role,
                                 IlrVerbalizationContext context)
        Produces the verbalization of the specified role using the provided verbalization context.
        Parameters:
        role - The role to verbalize.
        context - The verbalization context.
      • verbalizeProxy

        public static java.lang.String verbalizeProxy(IlrConcept concept,
                                      IlrVerbalizationContext context)
        Produces the verbalization, as a proxy, of the specified concept using the provided verbalization context.
        Parameters:
        concept - The concept to verbalize.
        context - The verbalization context.
      • getPlural

        public static java.lang.String getPlural(IlrVerbalizable verbalizable,
                                 IlrVocabulary vocabulary)
        Returns the plural label of the given verbalizable.
        Parameters:
        verbalizable - The verbalizable.
        vocabulary - The vocabulary.
        Returns:
        The default plural of verbalizable.
      • getDefaultPlural

        public static java.lang.String getDefaultPlural(IlrVerbalizable verbalizable,
                                        IlrVocabulary vocabulary)
        Returns the default plural of the given verbalizable.
        Parameters:
        verbalizable - The verbalizable.
        vocabulary - The vocabulary.
        Returns:
        The default plural of verbalizable.
      • getDefaultArticle

        public static java.lang.String getDefaultArticle(IlrVerbalizable verbalizable,
                                         IlrVocabulary vocabulary,
                                         IlrArticle article,
                                         boolean isPlural)
        Returns the default article of the given verbalizable.
        Parameters:
        verbalizable - The verbalizable.
        vocabulary - The vocabulary.
        article - The desired article.
        isPlural - true if the article to produce should be plural.
        Returns:
        The default article of verbalizable.
      • getDefaultGender

        public static IlrGender getDefaultGender(java.util.Locale locale)
        Returns the default gender, according to the given locale. To have the default gender for a given term, use getDefaultGender(String, Locale) method that takes a label.
        Parameters:
        locale - the locale.
        Returns:
        The default gender for that locale.
      • getDefaultGender

        public static IlrGender getDefaultGender(java.lang.String label,
                                 java.util.Locale locale)
        Returns the default gender for the given label, according to the given locale.
        Parameters:
        label - the label
        locale - the locale.
        Returns:
        The default gender for this label for that locale.
      • getDefaultSingular

        public static java.lang.String getDefaultSingular(java.lang.String label,
                                          IlrVocabulary vocabulary)
        This method returns the default singular term corresponding to the given plural label.
        Parameters:
        label -
        vocabulary -
        Returns:
        the singular and null if the verbalizer associated to this vocabulary locale is not able to provide a singular
      • getDefaultTerm

        public static IlrTerm getDefaultTerm(IlrVerbalizable verbalizable,
                             IlrVocabulary vocabulary)
        This methods returns a term based on the default verbalization of the given verbalizable, according to the given locale.
        Parameters:
        verbalizable -
        vocabulary -
        Returns:
        a term

© Copyright IBM Corp. 1987, 2017