Remove (read|write)PhraseSuggestionSmoothingModel

This commit is contained in:
Nik Everett 2016-04-18 21:00:47 -04:00
parent cd75c3da2e
commit 4169b00441
3 changed files with 2 additions and 26 deletions

View File

@ -759,15 +759,6 @@ public abstract class StreamInput extends InputStream {
return readNamedWriteable(ScoreFunctionBuilder.class);
}
/**
* Reads a {@link SmoothingModel} from the current stream
* @deprecated prefer {@link #readNamedWriteable(Class)} passing {@link SmoothingModel}.
*/
@Deprecated
public SmoothingModel readPhraseSuggestionSmoothingModel() throws IOException {
return readNamedWriteable(SmoothingModel.class);
}
/**
* Reads a list of objects
*/

View File

@ -714,15 +714,6 @@ public abstract class StreamOutput extends OutputStream {
writeNamedWriteable(scoreFunctionBuilder);
}
/**
* Writes the given {@link SmoothingModel} to the stream
* @deprecated prefer {@link #writeNamedWriteable(NamedWriteable)}
*/
@Deprecated
public void writePhraseSuggestionSmoothingModel(SmoothingModel smoothinModel) throws IOException {
writeNamedWriteable(smoothinModel);
}
/**
* Writes the given {@link GeoPoint} to the stream
*/

View File

@ -128,9 +128,7 @@ public class PhraseSuggestionBuilder extends SuggestionBuilder<PhraseSuggestionB
realWordErrorLikelihood = in.readFloat();
confidence = in.readFloat();
gramSize = in.readOptionalVInt();
if (in.readBoolean()) {
model = in.readPhraseSuggestionSmoothingModel();
}
model = in.readOptionalNamedWriteable(SmoothingModel.class);
forceUnigrams = in.readBoolean();
tokenLimit = in.readVInt();
preTag = in.readOptionalString();
@ -160,11 +158,7 @@ public class PhraseSuggestionBuilder extends SuggestionBuilder<PhraseSuggestionB
out.writeFloat(realWordErrorLikelihood);
out.writeFloat(confidence);
out.writeOptionalVInt(gramSize);
boolean hasModel = model != null;
out.writeBoolean(hasModel);
if (hasModel) {
out.writePhraseSuggestionSmoothingModel(model);
}
out.writeOptionalNamedWriteable(model);
out.writeBoolean(forceUnigrams);
out.writeVInt(tokenLimit);
out.writeOptionalString(preTag);