public static class NonsenseBuilder.Configuration
extends java.lang.Object
NonsenseBuilder
related to the
probability of certain random features.
To set non-default values, construct an instance of the class, and then
use its set*()
methods to change any or all of the desired
settings. This may be done inline as follows:
NonsenseBuilder xyzzy = new NonsenseBuilder( ctx, (new NonsenseBuilder.Configuration()) .setSubjectAdjectiveChance(25) .setAdverbChance( NonsenseBuilder.Configuration.ALWAYS ) .setObjectAdjectiveChance(42) .setObjectPhraseChance( NonsenseBuilder.Configuration.NEVER ) );
Modifier and Type | Field and Description |
---|---|
static int |
ALWAYS
When specifying a probability, this constant indicates that a word
should always be added to the sentence.
|
int |
m_nAdverbChance
The percentage chance that an adverb will be added to modify the verb
of the sentence.
|
int |
m_nObjectAdjectiveChance
The percentage chance that an adjective will be added to modify the
object of the sentence.
|
int |
m_nObjectPhraseChance
The percentage chance that a prepositional phrase will be added to
modify the object of the sentence.
|
int |
m_nSubjectAdjectiveChance
The percentage chance that an adjective will be added to modify the
subject of the sentence.
|
static int |
NEVER
When specifying a probability, this constant indicates that a word
should never be added to the sentence.
|
Constructor and Description |
---|
Configuration() |
Modifier and Type | Method and Description |
---|---|
NonsenseBuilder.Configuration |
setAdverbChance(int n)
Sets the probability that an adverb will be added to modify the verb
of the sentence.
|
NonsenseBuilder.Configuration |
setObjectAdjectiveChance(int n)
Sets the probability that an adjective will be added to modify the
object of the sentence.
|
NonsenseBuilder.Configuration |
setObjectPhraseChance(int n)
Sets the probability that a prepositional phrase will be added to
modify the object of the sentence.
|
NonsenseBuilder.Configuration |
setSubjectAdjectiveChance(int n)
Sets the probability that an adjective will be added to modify the
subject of the sentence.
|
public static final int ALWAYS
public static final int NEVER
public int m_nSubjectAdjectiveChance
public int m_nAdverbChance
public int m_nObjectAdjectiveChance
public int m_nObjectPhraseChance
public NonsenseBuilder.Configuration setSubjectAdjectiveChance(int n)
n
- an integer between 0 and 100, inclusivepublic NonsenseBuilder.Configuration setAdverbChance(int n)
n
- an integer between 0 and 100, inclusivepublic NonsenseBuilder.Configuration setObjectAdjectiveChance(int n)
n
- an integer between 0 and 100, inclusivepublic NonsenseBuilder.Configuration setObjectPhraseChance(int n)
n
- an integer between 0 and 100, inclusive