|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.siefkes.nlstego.textgen.StegoCoder
public class StegoCoder
Base class that contains common code shared by the
StegoEncoder and
StegoDecoder classes.
Instances of this class are not stateless and must be synchronized externally, if required.
| Constructor Summary | |
|---|---|
StegoCoder(Configuration conf,
TextModel model)
Creates a new instance. |
|
| Method Summary | |
|---|---|
protected void |
debugBits(int num0,
boolean added1,
int predIndex,
int predCount,
String token)
Adds a debug statement that allows tracing the encoding/decoding of bits. |
protected void |
debugSingleton(String token)
Adds a debug statement that allows tracing the occurrence of single-element prediction lists. |
protected List<PredictedToken> |
filterFirst(List<PredictedToken> predictions)
This method is called during encoding and decoding to filter unsuitable predictions for the very first token in a stego text. |
protected TextModel |
getTextModel()
Returns the text model used by this instance. |
protected void |
resetState()
Resets the state of this instance, to start encoding/decoding a new text sequence. |
String |
toString()
Returns a string representation of this object. |
protected void |
updateState(String token)
Updates the state of a text model after choosing a token. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public StegoCoder(Configuration conf,
TextModel model)
conf - the configuration to usemodel - the text model to use| Method Detail |
|---|
protected void debugBits(int num0,
boolean added1,
int predIndex,
int predCount,
String token)
NLStego.LOG.
num0 - the number of '0' bitsadded1 - whether a '1' bit followedpredIndex - the index of the current predictionpredCount - the number of active predictionstoken - the predicted tokenprotected void debugSingleton(String token)
NLStego.LOG.
token - the predicted tokenprotected List<PredictedToken> filterFirst(List<PredictedToken> predictions)
starting with whitespace to avoid confusion between tokens with and
without initial whitespace.
predictions - the original list of likely predictions
protected TextModel getTextModel()
protected void resetState()
protected void updateState(String token)
token - the chosen tokenpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||