org.dkpro.tc.api.features.Feature.getType()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(77)

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

Feature.getType介绍

暂无

代码示例

代码示例来源:origin: dkpro/dkpro-tc

private String getValue(Feature feature) {
  if (feature.getType().equals(FeatureType.STRING) || feature.getType().equals(FeatureType.NOMINAL)) {
    String value = feature.getValue().toString();
    String idx = stringToIntegerMap.get(value);
    if (idx == null) {
      stringToIntegerMap.put(value, "" + maxStringId++);
      idx = stringToIntegerMap.get(value);
    }
    return idx.toString();
  }
  return feature.getValue().toString();
}

代码示例来源:origin: org.dkpro.tc/dkpro-tc-core

public void collectMetaData(List<Instance> instances)
{
  featureNames = new TreeSet<>();
  for (Feature f : instances.get(0).getFeatures()) {
    featureNames.add(f.getName());
    if (!featDesc.containsKey(f.getName())) {
      featDesc.put(f.getName(), f.getType());
    }
    if (f.getType() == FeatureType.NOMINAL) {
      enumFeatureName.put(f.getName(), f.getValue().getClass().getName());
    }
  }
  didCollect = true;
}

代码示例来源:origin: dkpro/dkpro-tc

public void collectMetaData(List<Instance> instances)
{
  featureNames = new TreeSet<>();
  for (Feature f : instances.get(0).getFeatures()) {
    featureNames.add(f.getName());
    if (!featDesc.containsKey(f.getName())) {
      featDesc.put(f.getName(), f.getType());
    }
    if (f.getType() == FeatureType.NOMINAL) {
      enumFeatureName.put(f.getName(), f.getValue().getClass().getName());
    }
  }
  didCollect = true;
}

代码示例来源:origin: dkpro/dkpro-tc

bw.write(" ");
bw.write(f.getName() + ":"
    + mapStringValues(f.getType(), f.getValue().toString()));

代码示例来源:origin: org.dkpro.tc/dkpro-tc-ml-weka

if (feature.getType() == FeatureType.NUMERIC) {
else if (feature.getType() == FeatureType.BOOLEAN) {

代码示例来源:origin: dkpro/dkpro-tc

if (feature.getType() == FeatureType.NUMERIC) {
else if (feature.getType() == FeatureType.BOOLEAN) {

相关文章