public abstract class IlrDefaultVerbalizer extends java.lang.Object implements IlrVerbalizer
IlrVerbalizer.
You should subclass this abstract implementation as soon as you develop a new verbalizer
for a new locale.| Constructor and Description |
|---|
IlrDefaultVerbalizer()
Builds a default verbalizer, using a default label builder.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Clones this
IlrVerbalizer instance. |
java.lang.String |
generateTemplate(IlrSentence sentence,
java.util.List synRoles)
Produces the default template for
sentence, according to its category. |
IlrArticleBuilder |
getArticleBuilder()
Returns the article builder of this verbalizer.
|
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.
|
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.
|
java.lang.String |
getCollectionClearTemplate(IlrSentence sentence,
java.util.List synRoles)
This method returns a phrase template corresponding to the clear operation of a Collection.
|
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.
|
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.
|
IlrGender |
getDefaultGender()
Returns the default gender for the language of the verbalizer.
|
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.
|
IlrLabelBuilder |
getLabelBuilder()
Gets the label builder.
|
java.lang.String |
getOperatorTemplate(IlrSentence sentence,
java.util.List synRoles)
This method is not used.
|
IlrPluralBuilder |
getPluralBuilder()
Returns the plural builder of this verbalizer.
|
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.
|
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.
|
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.
|
IlrGender[] |
getSupportedGenders()
Returns the list of genders used for the current locale.
|
IlrTermBuilder |
getTermBuilder()
Gets the term builder
|
protected IlrArticleBuilder |
makeArticleBuilder()
This method is a factory method to create an Article Builder related to this verbalizer
|
protected IlrPluralBuilder |
makePluralBuilder()
This method is a factory method to create a Plural Builder related to this verbalizer
|
protected IlrTermBuilder |
makeTermBuilder()
This method is a factory method to create an Term Builder related to this verbalizer
|
void |
setLabelBuilder(IlrLabelBuilder labelBuilder)
Sets the label builder.
|
java.lang.String |
verbalize(IlrSentence sentence,
IlrVerbalizationContext context)
Verbalizes a
sentence, using the specified context. |
java.lang.String |
verbalize(IlrVerbalizable verbalizable,
IlrVerbalizationContext context)
Verbalizes a
verbalizable element, using the specified context. |
public IlrDefaultVerbalizer()
public java.lang.String verbalize(IlrVerbalizable verbalizable, IlrVerbalizationContext context) throws IlrVerbalizationException
IlrVerbalizerverbalizable element, using the specified context.
Note: make sure that the verbalization context is not modified.verbalize in interface IlrVerbalizerIlrVerbalizationExceptionverbalizable - The verbalizable element to verbalize.context - The verbalization context.verbalizable element, as specified in the context.public java.lang.String verbalize(IlrSentence sentence, IlrVerbalizationContext context) throws IlrVerbalizationException
IlrVerbalizersentence, using the specified context.
Note: make sure that the verbalization context is not modified.verbalize in interface IlrVerbalizerIlrVerbalizationExceptionsentence - The sentence to verbalize.context - The verbalization context.sentence as specified in context.public void setLabelBuilder(IlrLabelBuilder labelBuilder)
IlrVerbalizersetLabelBuilder in interface IlrVerbalizerlabelBuilder - The new label builder.public IlrLabelBuilder getLabelBuilder()
IlrVerbalizergetLabelBuilder in interface IlrVerbalizerpublic IlrGender getDefaultGender()
IlrVerbalizergetDefaultGender in interface IlrVerbalizerpublic IlrGender[] getSupportedGenders()
IlrVerbalizergetSupportedGenders in interface IlrVerbalizerIlrGender constants or null
if gender is not used for this locale.public java.lang.Object clone()
IlrVerbalizerIlrVerbalizer instance.clone in interface IlrVerbalizerclone in class java.lang.Objectpublic IlrArticleBuilder getArticleBuilder()
IlrVerbalizergetArticleBuilder in interface IlrVerbalizerprotected IlrArticleBuilder makeArticleBuilder()
public IlrPluralBuilder getPluralBuilder()
IlrVerbalizergetPluralBuilder in interface IlrVerbalizerprotected IlrPluralBuilder makePluralBuilder()
public IlrTermBuilder getTermBuilder()
IlrVerbalizergetTermBuilder in interface IlrVerbalizerprotected IlrTermBuilder makeTermBuilder()
public java.lang.String getGetterTemplate(IlrSentence sentence, java.util.List synRoles)
sentence - the sentence to be assigned the templatesynRoles - the list of syntactic role for this sentencepublic java.lang.String getSetterTemplate(IlrSentence sentence, java.util.List synRoles)
sentence - the sentence to be assigned the templatesynRoles - the list of syntactic role for this sentencepublic java.lang.String getClearerTemplate(IlrSentence sentence, java.util.List synRoles)
sentence - the sentence to be assigned the templatesynRoles - the list of syntactic role for this sentencepublic java.lang.String getPredicateGetterTemplate(IlrSentence sentence, java.util.List synRoles)
sentence - the sentence to be assigned the templatesynRoles - the list of syntactic role for this sentencepublic java.lang.String getPredicateSetterTemplate(IlrSentence sentence, java.util.List synRoles)
sentence - the sentence to be assigned the templatesynRoles - the list of syntactic role for this sentencepublic java.lang.String getOperatorTemplate(IlrSentence sentence, java.util.List synRoles)
public java.lang.String getCollectionAddTemplate(IlrSentence sentence, java.util.List synRoles)
sentence - the sentence to be assigned the templatesynRoles - the list of syntactic role for this sentencepublic java.lang.String getCollectionRemoveTemplate(IlrSentence sentence, java.util.List synRoles)
sentence - the sentence to be assigned the templatesynRoles - the list of syntactic role for this sentencepublic java.lang.String getCollectionClearTemplate(IlrSentence sentence, java.util.List synRoles)
sentence - the sentence to be assigned the templatesynRoles - the list of syntactic role for this sentencepublic java.lang.String getConstructorTemplate(IlrSentence sentence, java.util.List synRoles)
sentence - the sentence to be assigned the templatesynRoles - the list of syntactic role for this sentencepublic java.lang.String generateTemplate(IlrSentence sentence, java.util.List synRoles)
IlrVerbalizersentence, according to its category.generateTemplate in interface IlrVerbalizersentence - 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.© Copyright IBM Corp. 1987, 2017