当前位置: 首页>>代码示例>>Java>>正文


Java MorphoFeatureType.valueOf方法代码示例

本文整理汇总了Java中edu.stanford.nlp.international.morph.MorphoFeatureSpecification.MorphoFeatureType.valueOf方法的典型用法代码示例。如果您正苦于以下问题:Java MorphoFeatureType.valueOf方法的具体用法?Java MorphoFeatureType.valueOf怎么用?Java MorphoFeatureType.valueOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.stanford.nlp.international.morph.MorphoFeatureSpecification.MorphoFeatureType的用法示例。


在下文中一共展示了MorphoFeatureType.valueOf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setup

import edu.stanford.nlp.international.morph.MorphoFeatureSpecification.MorphoFeatureType; //导入方法依赖的package包/类
@Override
public void setup(File path, String... options) {
  //Setup the Bies tag mapping
  super.setup(path, new String[0]);
  
  for(String opt : options) {
    String[] optToks = opt.split(":");
    if(optToks[0].equals("UniversalMap") && optToks.length == 2) {
      loadUniversalMap(optToks[1]);
    
    } else {
      //Maybe it's a morphological feature
      //Both of these calls will throw exceptions if the feature is illegal/invalid
      MorphoFeatureType feat = MorphoFeatureType.valueOf(optToks[0]);
      List<String> featVals = morphoSpec.getValues(feat);
      morphoSpec.activate(feat);
    }
  }
}
 
开发者ID:amark-india,项目名称:eventspotter,代码行数:20,代码来源:UniversalPOSMapper.java

示例2: fromTagString

import edu.stanford.nlp.international.morph.MorphoFeatureSpecification.MorphoFeatureType; //导入方法依赖的package包/类
/**
 * Assumes that the tag string has been formed using a call to getTag(). As such,
 * it removes the basic category from the feature string.
 * <p>
 * Note that this method returns a <b>new</b> MorphoFeatures object. As a result, it
 * behaves like a static method, but is non-static so that subclasses can override
 * this method.
 * 
 * @param str
 */
public MorphoFeatures fromTagString(String str) {
  List<String> feats = Arrays.asList(str.split("\\-"));
  MorphoFeatures mFeats = new MorphoFeatures();
  for(String fPair : feats) {
    String[] keyValue = fPair.split(KEY_VAL_DELIM);
    if(keyValue.length != 2)//Manual state split annotations
      continue;
    MorphoFeatureType fName = MorphoFeatureType.valueOf(keyValue[0].trim());
    mFeats.addFeature(fName, keyValue[1].trim());
  }
  
  return mFeats;
}
 
开发者ID:paulirwin,项目名称:Stanford.NER.Net,代码行数:24,代码来源:MorphoFeatures.java

示例3: setupMorphoFeatures

import edu.stanford.nlp.international.morph.MorphoFeatureSpecification.MorphoFeatureType; //导入方法依赖的package包/类
/**
 * Configures morpho-syntactic annotations for POS tags.
 *
 * @param activeFeats A comma-separated list of feature values with names according
 * to MorphoFeatureType.
 *
 */
private String setupMorphoFeatures(String activeFeats) {
  String[] feats = activeFeats.split(",");
  morphoSpec = tlp.morphFeatureSpec();
  for(String feat : feats) {
    MorphoFeatureType fType = MorphoFeatureType.valueOf(feat.trim());
    morphoSpec.activate(fType);
  }
  return morphoSpec.toString();
}
 
开发者ID:benblamey,项目名称:stanford-nlp,代码行数:17,代码来源:ArabicTreebankParserParams.java


注:本文中的edu.stanford.nlp.international.morph.MorphoFeatureSpecification.MorphoFeatureType.valueOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。