Package org.fnlp.util.exception

Examples of org.fnlp.util.exception.UnsupportedDataTypeException


        }else if (data instanceof List) {
            list = ngram((List) data,gramSizes);
        }else if(data instanceof String[]){
            list = ngram((String[]) data,gramSizes);
        }else{
            throw new UnsupportedDataTypeException("不支持处理数据类型:"+data.getClass().toString());
        }
        inst.setData(list);
    }
View Full Code Here


      int[] newTarget = new int[l.size()];
      for (int i = 0; i < l.size(); ++i)
        newTarget[i] = labelAlphabet.lookupIndex((String) l.get(i));
      instance.setTarget(newTarget);
    }else{
      throw new UnsupportedDataTypeException(t.getClass().toString());
    }
  }
View Full Code Here

      for(int i=0;i<ssdata.size();i++){
        ArrayList<String> idata =  (ArrayList<String>) ssdata.get(i);
        data[i] = idata.toArray(new String[idata.size()]);
      }     
    }else{
      throw new UnsupportedDataTypeException(sdata.getClass().toString());
    }
    instance.setData(data);
   
    int len = data[0].length;
    int[][] newData = new int[len][templets.size()];
View Full Code Here

   */
 
  public void setDefaultPOS(String pos) throws UnsupportedDataTypeException{
    int lpos = postagAlphabet.lookupIndex(pos);
    if(lpos==-1){     
        throw new UnsupportedDataTypeException("不支持词性:"+pos);
    }
    defaultPOS = pos;
  }
View Full Code Here

    Instance inst = new Instance(features.indices());

    String pos = state.getLeftPos();
    int lpos = postagAlphabet.lookupIndex(pos);
    if(lpos==-1)
      throw new UnsupportedDataTypeException("不支持词性:"+pos);
    LabelAlphabet actionList = factory.buildLabelAlphabet(pos);
   
    Predict<Integer> ret = models[lpos].classify(inst, actionList.size());
    Object[] guess = ret.labels;
   
View Full Code Here

TOP

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

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.