Examples of HierarchyVersion


Examples of edu.msu.cme.rdp.classifier.utils.HierarchyVersion

    public static HierarchyVersion createLogWordPriorArr(Reader r, float[] arr, HierarchyVersion version) throws IOException, TrainingDataException {
        BufferedReader reader = new BufferedReader(r);
        String line = reader.readLine();
        if (line != null) {

            HierarchyVersion thisVersion = new HierarchyVersion(line);
            int trainsetNo = thisVersion.getTrainsetNo();

            if (thisVersion.getVersion() == null) {
                throw new TrainingDataException("Error: There is no version information "
                        + "in the wordPrior file");
            }
            if (version == null) {
                version = thisVersion;
            } else if (!version.getVersion().equals(thisVersion.getVersion()) || version.getTrainsetNo() != thisVersion.getTrainsetNo()) {
                throw new TrainingDataException("Error: The version information in the wordPrior file is different from the version of the other training files.");
            }
        }

View Full Code Here

Examples of edu.msu.cme.rdp.classifier.utils.HierarchyVersion

        // the first line contains the version information
        // check if it's the same as version from the other training files

        String line = infile.readLine();
        if (line != null) {
            HierarchyVersion thisVersion = new HierarchyVersion(line);
            int trainsetNo = thisVersion.getTrainsetNo();

            if (thisVersion.getVersion() == null) {
                throw new TrainingDataException("Error: There is no version information "
                        + "in the bergeyTree file");
            }
            if (version == null) {
                version = thisVersion;
            } else if (!version.getVersion().equals(thisVersion.getVersion()) || version.getTrainsetNo() != thisVersion.getTrainsetNo()) {
                throw new TrainingDataException("Error: The version information in the bergeyTree file is different from the version of the other training files.");
            }
        }

        while ((line = infile.readLine()) != null) {
View Full Code Here

Examples of edu.msu.cme.rdp.classifier.utils.HierarchyVersion

    public static HierarchyVersion createGenusWordProbList(Reader r, List<GenusWordConditionalProb> aList, HierarchyVersion version) throws IOException, TrainingDataException {
        BufferedReader reader = new BufferedReader(r);
        String line = reader.readLine();

        if (line != null) {
            HierarchyVersion thisVersion = new HierarchyVersion(line);
            int trainsetNo = thisVersion.getTrainsetNo();

            if (thisVersion.getVersion() == null) {
                throw new TrainingDataException("Error: There is no version information "
                        + "in the probabilityList file");
            }
            if (version == null) {
                version = thisVersion;
            } else if (!version.getVersion().equals(thisVersion.getVersion()) || version.getTrainsetNo() != thisVersion.getTrainsetNo()) {
                throw new TrainingDataException("Error: The version information in the probabilityList file is different from the version of the other training files.");
            }
        }

        while ((line = reader.readLine()) != null) {
View Full Code Here

Examples of edu.msu.cme.rdp.classifier.utils.HierarchyVersion

    public static HierarchyVersion createProbIndexArr(Reader r, int[] arr, HierarchyVersion version) throws IOException, TrainingDataException {
        BufferedReader reader = new BufferedReader(r);
        String line = reader.readLine();

        if (line != null) {
            HierarchyVersion thisVersion = new HierarchyVersion(line);
            int trainsetNo = thisVersion.getTrainsetNo();

            if (thisVersion.getVersion() == null) {
                throw new TrainingDataException("Error: There is no version information "
                        + "in the probabilityIndex file");
            }
            if (version == null) {
                version = thisVersion;
            } else if (!version.getVersion().equals(thisVersion.getVersion()) || version.getTrainsetNo() != thisVersion.getTrainsetNo()) {
                throw new TrainingDataException("Error: The version information in the probabilityIndex file is different from the version of the other training files.");
            }
        }

        while ((line = reader.readLine()) != null) {
View Full Code Here

Examples of edu.msu.cme.rdp.classifier.utils.HierarchyVersion

  /** Test of parseTreeFile method, of class classification.TrainingFileParser. */
  public void testParseTreeFile() throws Exception{
    System.out.println("testParseTreeFile");
    TreeFileParser parser = new TreeFileParser();
    InputStream dstream = System.class.getResourceAsStream("/test/classifier/testTreeFile.xml");
    HierarchyVersion hVersion = null;
   
    Reader in =  new InputStreamReader( dstream );
    HierarchyTree root = parser.createTree(in, null);
    assertEquals(root.getName(), "BACTERIA");
    assertEquals(root.getLeaveCount(), 4123);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.