Class OpennlpUtil


  • public final class OpennlpUtil
    extends Object
    This class contains util methods for the maxent library.
    • Method Detail

      • loadBytes

        public static byte[] loadBytes​(File inFile)
                                throws IOException
        Loads data from a given File.
        Parameters:
        inFile - The File to read bytes from.
        Returns:
        The bytes that have been read.
        Throws:
        IOException - Thrown if IO errors occurred.
      • loadTrainingParams

        public static TrainingParameters loadTrainingParams​(String inFileValue,
                                                            boolean isSequenceTrainingAllowed)
                                                     throws org.apache.uima.resource.ResourceInitializationException
        Loads data from a given File.
        Parameters:
        inFileValue - The name of the File to read bytes from.
        isSequenceTrainingAllowed - Whether the TrainerFactory.TrainerType.SEQUENCE_TRAINER method is allowed or not.
        Returns:
        The TrainingParameters that have been read.
        Throws:
        org.apache.uima.resource.ResourceInitializationException - Thrown if IO errors occurred or the inFileValue does not reference a valid training parameters file.