Java Code Examples for codemining.util.serialization.ISerializationStrategy.SerializationException#printStackTrace()

The following examples show how to use codemining.util.serialization.ISerializationStrategy.SerializationException#printStackTrace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CodeUtils.java    From tassal with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Save folds or tokens to file using Kryo serializer
 *
 * @author Jaroslav Fowkes
 */
public static <K, V> void saveFolds(final HashMap<K, V> folds, final String path) {

	try {
		Serializer.getSerializer().serialize(folds, path);
		System.out.printf("Folds saved in " + path);

	} catch (final SerializationException e) {
		e.printStackTrace();
	}
}
 
Example 2
Source File: GibbsSampler.java    From tassal with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/** Serialize the present sampler state */
public void saveSelf(final String path) {
	try {
		Serializer.getSerializer().serialize(this, path);
		System.out.printf("Gibbs sampler state saved in " + path);
	} catch (final SerializationException e) {
		e.printStackTrace();
	}
}
 
Example 3
Source File: GibbsSampler.java    From tassal with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/** Read in and return serialized sampler */
public static GibbsSampler readCorpus(final String serPath) {
	GibbsSampler sampler = null;
	try {
		sampler = (GibbsSampler) Serializer.getSerializer()
				.deserializeFrom(serPath);
	} catch (final SerializationException e) {
		e.printStackTrace();
	}
	return sampler;
}