Modified: opennlp/trunk/opennlp-uima/src/main/java/opennlp/uima/util/OpennlpUtil.java URL: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-uima/src/main/java/opennlp/uima/util/OpennlpUtil.java?rev=1591889&r1=1591888&r2=1591889&view=diff ============================================================================== --- opennlp/trunk/opennlp-uima/src/main/java/opennlp/uima/util/OpennlpUtil.java (original) +++ opennlp/trunk/opennlp-uima/src/main/java/opennlp/uima/util/OpennlpUtil.java Fri May 2 12:34:23 2014 @@ -45,7 +45,7 @@ final public class OpennlpUtil { /** * Serializes a {@link GISModel} and writes it to the given * {@link OutputStream}. - * + * * @param model model to serialize * @throws IOException IOException */ @@ -61,17 +61,17 @@ final public class OpennlpUtil { modelOut.close(); } } - + public static final byte[] loadBytes(File inFile) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - + InputStream in = null; try { in = new FileInputStream(inFile); - + byte buffer[] = new byte[1024]; int len; - + while ((len = in.read(buffer)) > 0) { bytes.write(buffer, 0, len); } @@ -80,7 +80,7 @@ final public class OpennlpUtil { if (in != null) in.close(); } - + return bytes.toByteArray(); }
Modified: opennlp/trunk/opennlp-uima/src/main/java/opennlp/uima/util/SampleTraceStream.java URL: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-uima/src/main/java/opennlp/uima/util/SampleTraceStream.java?rev=1591889&r1=1591888&r2=1591889&view=diff ============================================================================== --- opennlp/trunk/opennlp-uima/src/main/java/opennlp/uima/util/SampleTraceStream.java (original) +++ opennlp/trunk/opennlp-uima/src/main/java/opennlp/uima/util/SampleTraceStream.java Fri May 2 12:34:23 2014 @@ -30,33 +30,33 @@ import opennlp.tools.util.ObjectStream; * @param <T> */ public class SampleTraceStream<T> extends FilterObjectStream<T, T> { - + private final Writer out; - + private boolean wasReseted = false; - + public SampleTraceStream(ObjectStream<T> samples, Writer out) { super(samples); - + this.out = out; } - + @Override public void reset() throws IOException, UnsupportedOperationException { super.reset(); - + wasReseted = true; } - + public T read() throws IOException { - + T sample = samples.read(); - + if (sample != null && !wasReseted) { out.append(sample.toString()); out.append('\n'); } - + return sample; } } Modified: opennlp/trunk/opennlp-uima/src/main/java/opennlp/uima/util/UimaUtil.java URL: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-uima/src/main/java/opennlp/uima/util/UimaUtil.java?rev=1591889&r1=1591888&r2=1591889&view=diff ============================================================================== --- opennlp/trunk/opennlp-uima/src/main/java/opennlp/uima/util/UimaUtil.java (original) +++ opennlp/trunk/opennlp-uima/src/main/java/opennlp/uima/util/UimaUtil.java Fri May 2 12:34:23 2014 @@ -13,7 +13,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ + */ package opennlp.uima.util; @@ -30,11 +30,11 @@ import org.apache.uima.cas.text.Annotati * This is a util class for uima operations. */ public final class UimaUtil { - + private UimaUtil(){ // this is util class must not be instantiated } - + /** * The token type parameter. */ @@ -54,12 +54,12 @@ public final class UimaUtil { * The sentence type parameter. */ public static String SENTENCE_TYPE_PARAMETER = "opennlp.uima.SentenceType"; - + /** * The beam size parameter. */ public static final String BEAM_SIZE_PARAMETER = "opennlp.uima.BeamSize"; - + public static final String LANGUAGE_PARAMETER = "opennlp.uima.Language"; public static final String DICTIONARY_PARAMETER = "opennlp.uima.Dictionary"; @@ -67,25 +67,25 @@ public final class UimaUtil { public static final String TRAINING_PARAMS_FILE_PARAMETER = "opennlp.uima.TrainingParamsFile"; public static final String CUTOFF_PARAMETER = "opennlp.uima.Cutoff"; - + public static final String ITERATIONS_PARAMETER = "opennlp.uima.Iterations"; - + public static final String PROBABILITY_FEATURE_PARAMETER = "opennlp.uima.ProbabilityFeature"; public static final String IS_REMOVE_EXISTINGS_ANNOTAIONS = "opennlp.uima.IsRemoveExistingAnnotations"; - + public static final String ADDITIONAL_TRAINING_DATA_FILE = "opennlp.uima.AdditionalTrainingDataFile"; - + public static final String ADDITIONAL_TRAINING_DATA_ENCODING = "opennlp.uima.AdditionalTrainingDataEncoding"; - + /** * Removes all annotations of type removeAnnotationType which are contained * by annotations of type containerAnnotationType. - * + * * @param cas * @param containerAnnotation * @param removeAnnotationType
