cc.mallet.types.Instance.setData()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中cc.mallet.types.Instance.setData()方法的一些代码示例,展示了Instance.setData()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.setData()方法的具体详情如下:
包路径:cc.mallet.types.Instance
类名称:Instance
方法名:setData

Instance.setData介绍

暂无

代码示例

代码示例来源:origin: de.julielab/jcore-mallet-2.0.9

public Instance pipe (Instance carrier)
{
  String string = ((CharSequence)carrier.getData()).toString();
  Matcher m = regex.matcher(string);
  carrier.setData(m.replaceAll (replacement));
  return carrier;
}

代码示例来源:origin: cc.mallet/mallet

public Instance pipe (Instance carrier)
{
  String string = ((CharSequence)carrier.getData()).toString();
  Matcher m = regex.matcher(string);
  carrier.setData(m.replaceAll (replacement));
  return carrier;
}

代码示例来源:origin: cc.mallet/mallet

public Instance pipe (Instance carrier)
{
  String string = ((CharSequence)carrier.getData()).toString();
  Matcher m = UU_ENCODED_LINE.matcher(string);
  carrier.setData(m.replaceAll (""));
  return carrier;
}

代码示例来源:origin: cc.mallet/mallet

public Instance pipe (Instance carrier)
{
  
  if (!(carrier.getData() instanceof CharSequence)) 
    throw new IllegalArgumentException ();
  String s = carrier.getData().toString();
  String[] lines = s.split (System.getProperty ("line.separator"));
  carrier.setData (new TokenSequence (lines));
  return carrier;
}

代码示例来源:origin: cc.mallet/mallet

public Instance next ()
{
  Instance carrier = super.next();
  carrier.setData(((File)carrier.getData()).toURI());
  return carrier;
}

代码示例来源:origin: de.julielab/jcore-mallet-2.0.9

public Instance pipe (Instance carrier) {
  if (carrier.getData() instanceof CharSequence) {
    CharSequence data = (CharSequence) carrier.getData();
    carrier.setData(data.toString().toLowerCase());
  }
  else {
    throw new IllegalArgumentException("CharSequenceLowercase expects a CharSequence, found a " + carrier.getData().getClass());
  }
  return carrier;
}

代码示例来源:origin: com.github.steveash.mallet/mallet

public Instance pipe (Instance carrier) {
  if (carrier.getData() instanceof CharSequence) {
    CharSequence data = (CharSequence) carrier.getData();
    carrier.setData(data.toString().toLowerCase());
  }
  else {
    throw new IllegalArgumentException("CharSequenceLowercase expects a CharSequence, found a " + carrier.getData().getClass());
  }
  return carrier;
}

代码示例来源:origin: com.github.steveash.mallet/mallet

public Instance pipe (Instance carrier)
{
  
  if (!(carrier.getData() instanceof CharSequence)) 
    throw new IllegalArgumentException ();
  String s = carrier.getData().toString();
  String[] lines = s.split (System.getProperty ("line.separator"));
  carrier.setData (new TokenSequence (lines));
  return carrier;
}

代码示例来源:origin: de.julielab/jcore-mallet-2.0.9

public Instance pipe (Instance carrier)
  {
    carrier.setData(new AugmentableFeatureVector ((FeatureSequence)carrier.getData(), binary));
    return carrier;
  }
}

代码示例来源:origin: com.github.steveash.mallet/mallet

public Instance pipe (Instance carrier) {
    carrier.setData(new ArrayIterator ((Object[])carrier.getData()));
    return carrier;
  }
}

代码示例来源:origin: com.github.steveash.mallet/mallet

public Instance pipe (Instance carrier)
{
carrier.setData(new TokenSequence((CharSequence[]) carrier.getData()));
  return carrier;
}

代码示例来源:origin: cc.mallet/mallet

public Instance pipe (Instance carrier)
  {
    carrier.setData(new AugmentableFeatureVector ((FeatureSequence)carrier.getData(), binary));
    return carrier;
  }
}

代码示例来源:origin: cc.mallet/mallet

public Instance pipe (Instance carrier)
{
carrier.setData(new TokenSequence((CharSequence[]) carrier.getData()));
  return carrier;
}

代码示例来源:origin: cc.mallet/mallet

public Instance pipe (Instance carrier)
{
  File directory = (File) carrier.getData();
  carrier.setData(new FileIterator (directory, fileFilter, labelPattern));
  return carrier;
}

代码示例来源:origin: de.julielab/jcore-mallet-2.0.9

public Instance pipe (Instance carrier)
{
  FeatureVector fv = (FeatureVector) carrier.getData();
  carrier.setData(new FeatureVector (fv, fv.getAlphabet(), null, null));
  return carrier;
}

代码示例来源:origin: com.github.steveash.mallet/mallet

public Instance pipe (Instance carrier)
{
  FeatureVector fv = (FeatureVector) carrier.getData();
  carrier.setData(new FeatureVector (fv, fv.getAlphabet(), null, null));
  return carrier;
}

代码示例来源:origin: cc.mallet/mallet

public Instance pipe (Instance carrier)
{
  FeatureVector fv = (FeatureVector) carrier.getData();
  carrier.setData(new FeatureVector (fv, fv.getAlphabet(), null, null));
  return carrier;
}

代码示例来源:origin: com.github.steveash.mallet/mallet

public Instance pipe (Instance carrier)
{
  if (augmentable)
    carrier.setData(new AugmentableFeatureVector ((Alphabet)getDataAlphabet(),
                                                  ((Token)carrier.getData()).getFeatures(),
                                                  binary));
  else
    carrier.setData(new FeatureVector ((Alphabet)getDataAlphabet(),
                                       ((Token)carrier.getData()).getFeatures(),
                                       binary));
  return carrier;
}

代码示例来源:origin: cc.mallet/mallet

public Instance pipe (Instance carrier)
{
  TokenSequence ts = (TokenSequence) carrier.getData();
  FeatureSequence ret =
    new FeatureSequence ((Alphabet)getDataAlphabet(), ts.size());
  for (int i = 0; i < ts.size(); i++) {
    ret.add (ts.get(i).getText());
  }
  carrier.setData(ret);
  return carrier;
}

代码示例来源:origin: cc.mallet/mallet

public Instance pipe (Instance carrier)
{
  CharSequence string = (CharSequence) carrier.getData();
  lexer.setCharSequence (string);
  TokenSequence ts = new StringTokenization (string);
  while (lexer.hasNext()) {
    lexer.next();
    ts.add (new StringSpan (string, lexer.getStartOffset (), lexer.getEndOffset ()));
  }
  carrier.setData(ts);
  return carrier;
}

相关文章