ilog.rules.vocabulary.verbalization

Interface IlrVerbalizer

  • All Superinterfaces:
    java.lang.Cloneable
    All Known Implementing Classes:
    IlrDefaultVerbalizer


    public interface IlrVerbalizer
    extends java.lang.Cloneable
    Interface for verbalizers. A verbalizer is responsible for producing phrases in a natural language from an IlrVerbalizable element or an IlrSentence. It is also responsible for producing some default phrase templates. A verbalizer is attached to a locale. This interface should not be implemented directly. Implementation of verbalizer should subclass IlrDefaultVerbalizer.
    • Method Detail

      • verbalize

        java.lang.String verbalize(IlrVerbalizable verbalizable,
                                 IlrVerbalizationContext context)
                                   throws IlrVerbalizationException
        Verbalizes a verbalizable element, using the specified context. Note: make sure that the verbalization context is not modified.
        Throws:
        IlrVerbalizationException
        Parameters:
        verbalizable - The verbalizable element to verbalize.
        context - The verbalization context.
        Returns:
        The verbalization of the verbalizable element, as specified in the context.
      • verbalize

        java.lang.String verbalize(IlrSentence sentence,
                                 IlrVerbalizationContext context)
                                   throws IlrVerbalizationException
        Verbalizes a sentence, using the specified context. Note: make sure that the verbalization context is not modified.
        Throws:
        IlrVerbalizationException
        Parameters:
        sentence - The sentence to verbalize.
        context - The verbalization context.
        Returns:
        The verbalization of sentence as specified in context.
      • getArticleBuilder

        IlrArticleBuilder getArticleBuilder()
        Returns the article builder of this verbalizer.
        Returns:
        The article builder of this verbalizer.
      • getPluralBuilder

        IlrPluralBuilder getPluralBuilder()
        Returns the plural builder of this verbalizer.
        Returns:
        The plural builder of this verbalizer.
      • setLabelBuilder

        void setLabelBuilder(IlrLabelBuilder labelBuilder)
        Sets the label builder.
        Parameters:
        labelBuilder - The new label builder.
      • getLabelBuilder

        IlrLabelBuilder getLabelBuilder()
        Gets the label builder.
        Returns:
        The label builder.
      • getTermBuilder

        IlrTermBuilder getTermBuilder()
        Gets the term builder
        Returns:
        The term builder.
      • getDefaultGender

        IlrGender getDefaultGender()
        Returns the default gender for the language of the verbalizer.
        Returns:
        The default gender.
      • getSupportedGenders

        IlrGender[] getSupportedGenders()
        Returns the list of genders used for the current locale.
        Returns:
        An array of IlrGender constants or null if gender is not used for this locale.
      • clone

        java.lang.Object clone()
        Clones this IlrVerbalizer instance.
        Returns:
        The clone of this instance.
      • generateTemplate

        java.lang.String generateTemplate(IlrSentence sentence,
                                        java.util.List synRoles)
        Produces the default template for sentence, according to its category.
        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