Package org.fnlp.util.exception

Examples of org.fnlp.util.exception.LoadModelException


   * @throws LoadModelException
   */
  public AbstractTagger(String file) throws LoadModelException  {
    loadFrom(file);
    if(getClassifier()==null){
      throw new LoadModelException("模型为空");
    }

    factory = getClassifier().getAlphabetFactory();
    labels = factory.DefaultLabelAlphabet();
    IFeatureAlphabet features = factory.DefaultFeatureAlphabet();
View Full Code Here


          new GZIPInputStream(new FileInputStream(modelfile))));
      templets = (TempletGroup) in.readObject();
      setClassifier((Linear) in.readObject());
      in.close();
    } catch (Exception e) {
      throw new LoadModelException(e,modelfile);
    }
  }
View Full Code Here

      ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(
          new BufferedInputStream(new FileInputStream(file))));
      cl = (BayesClassifier) in.readObject();
      in.close();
    } catch (Exception e) {
      throw new LoadModelException(e,file);
    }
    return cl;
  }
View Full Code Here

      ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(
          new BufferedInputStream(new FileInputStream(file))));
      cl = (KNNClassifier) in.readObject();
      in.close();
    } catch (Exception e) {
      throw new LoadModelException(e,file);
    }
    return cl;
 
View Full Code Here

   * @throws LoadModelException
   */
  public POSTagger(CWSTagger cws, String str) throws LoadModelException {
    super(str);
    if(cws==null)
      throw new LoadModelException("分词模型不能为空");
    this.cws = cws; 
  }
View Full Code Here

      ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(
          new BufferedInputStream(new FileInputStream(file))));
      cl = (Linear) in.readObject();
      in.close();
    } catch (Exception e) {
      throw new LoadModelException(e,file);
    }
    return cl;
  }
View Full Code Here

      ArrayList<String[]> al = loadDict(path);   
      add(al);
      indexLen = MIN_LEN;
      createIndex();
    } catch (IOException e) {
      throw new LoadModelException("加载词典错误"+e.toString());
    }
  }
View Full Code Here

      ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(
          new BufferedInputStream(new FileInputStream(file))));
      cl = (KNN) in.readObject();
      in.close();
    } catch (Exception e) {
      throw new LoadModelException(e,file);
    }
    return cl;
  }
View Full Code Here

      ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(
          new BufferedInputStream(new FileInputStream(file))));
      cl = (Linear) in.readObject();
      in.close();
    } catch (Exception e) {
      throw new LoadModelException("分类器读入错误");
    }
    return cl;
  }
View Full Code Here

TOP

Related Classes of org.fnlp.util.exception.LoadModelException

Copyright © 2018 www.massapicom. 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.