public class TextGenerator extends AbstractOptionHandler implements InstanceStream
Modifier and Type | Field and Description |
---|---|
protected int[] |
classTwitterGenerator |
protected int |
countTweets |
protected double[] |
freqTwitterGenerator |
protected Random |
instanceRandom |
IntOption |
instanceRandomSeedOption |
protected double |
lengthTweet |
IntOption |
numAttsOption |
protected double |
probNegative |
protected double |
probPositive |
protected int |
sizeTable |
protected InstancesHeader |
streamHeader |
protected double[] |
sumFreqTwitterGenerator |
protected int[] |
wordTwitterGenerator |
protected double |
zipfExponent |
config
Constructor and Description |
---|
TextGenerator() |
Modifier and Type | Method and Description |
---|---|
void |
changeFreqWords(int numberWords) |
void |
changePolarity(int numberWords) |
long |
estimatedRemainingInstances()
Gets the estimated number of remaining instances in this stream
|
void |
getDescription(StringBuilder sb,
int indent)
Returns a string representation of this object.
|
InstancesHeader |
getHeader()
Gets the header of this stream.
|
boolean |
hasMoreInstances()
Gets whether this stream has more instances to output.
|
boolean |
isRestartable()
Gets whether this stream can restart.
|
InstanceExample |
nextInstance()
Gets the next example from this stream.
|
protected void |
prepareForUseImpl(TaskMonitor monitor,
ObjectRepository repository)
This method describes the implementation of how to prepare this object for use.
|
void |
restart()
Restarts this stream.
|
copy, getCLICreationString, getOptions, getPreparedClassOption, getPurposeString, prepareClassOptions, prepareForUse, prepareForUse
copy, measureByteSize, measureByteSize, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
copy, measureByteSize
public IntOption numAttsOption
public IntOption instanceRandomSeedOption
protected InstancesHeader streamHeader
protected Random instanceRandom
protected int[] wordTwitterGenerator
protected double[] freqTwitterGenerator
protected double[] sumFreqTwitterGenerator
protected int[] classTwitterGenerator
protected int sizeTable
protected double probPositive
protected double probNegative
protected double zipfExponent
protected double lengthTweet
protected int countTweets
public InstancesHeader getHeader()
ExampleStream
getHeader
in interface ExampleStream<Example<Instance>>
public long estimatedRemainingInstances()
ExampleStream
estimatedRemainingInstances
in interface ExampleStream<Example<Instance>>
public boolean hasMoreInstances()
ExampleStream
hasMoreInstances
in interface ExampleStream<Example<Instance>>
public InstanceExample nextInstance()
ExampleStream
nextInstance
in interface ExampleStream<Example<Instance>>
public boolean isRestartable()
ExampleStream
isRestartable
in interface ExampleStream<Example<Instance>>
public void restart()
ExampleStream
restart
in interface ExampleStream<Example<Instance>>
protected void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository)
AbstractOptionHandler
prepareForUseImpl
and not prepareForUse
since
prepareForUse
calls prepareForUseImpl
.prepareForUseImpl
in class AbstractOptionHandler
monitor
- the TaskMonitor to userepository
- the ObjectRepository to usepublic void getDescription(StringBuilder sb, int indent)
MOAObject
AbstractMOAObject.toString
to give a string representation of the object.getDescription
in interface MOAObject
sb
- the stringbuilder to add the descriptionindent
- the number of characters to indentpublic void changePolarity(int numberWords)
public void changeFreqWords(int numberWords)
Copyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.