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


Java StringUtils.EMPTY_STRING_ARRAY属性代码示例

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


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

示例1: GrammaticalRelation

public GrammaticalRelation(Language language,
                           String shortName,
                           String longName,
                           Class<? extends GrammaticalRelationAnnotation> annotation,
                           GrammaticalRelation parent) {
  this(language, shortName, longName, annotation, parent, null, StringUtils.EMPTY_STRING_ARRAY, null);
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:7,代码来源:GrammaticalRelation.java

示例2: GrammaticalRelation

public GrammaticalRelation(Language language,
                           String shortName,
                           String longName,
                           Class<? extends GrammaticalRelationAnnotation> annotation,
                           GrammaticalRelation parent) {
  this(language, shortName, longName, annotation, parent, null, null, StringUtils.EMPTY_STRING_ARRAY, null);
}
 
开发者ID:paulirwin,项目名称:Stanford.NER.Net,代码行数:7,代码来源:GrammaticalRelation.java

示例3: parseClassConstructArgs

private static String[] parseClassConstructArgs(String namePlusArgs) {
  String[] args = StringUtils.EMPTY_STRING_ARRAY;
  String name = namePlusArgs;
  if (namePlusArgs.matches(".*\\([^)]*\\)$")) {
    String argStr = namePlusArgs.replaceFirst("^.*\\(([^)]*)\\)$", "$1");
    args = argStr.split(",");
    name = namePlusArgs.replaceFirst("\\([^)]*\\)$", "");
  }
  String[] tokens = new String[1 + args.length];
  tokens[0] = name;
  System.arraycopy(args, 0, tokens, 1, args.length);
  return tokens;
}
 
开发者ID:paulirwin,项目名称:Stanford.NER.Net,代码行数:13,代码来源:GrammaticalStructure.java

示例4: wsvStringToStringArray

private static String[] wsvStringToStringArray(String str) {
  if (str == null || str.equals("")) {
    return StringUtils.EMPTY_STRING_ARRAY;
  } else {
    return str.split("\\s+");
  }
}
 
开发者ID:benblamey,项目名称:stanford-nlp,代码行数:7,代码来源:TaggerConfig.java

示例5: convertFlagsToArray

public static String[] convertFlagsToArray(String parserFlags) {
  if (parserFlags == null) {
    return DEFAULT_FLAGS;
  } else if (parserFlags.trim().equals("")) {
    return StringUtils.EMPTY_STRING_ARRAY;
  } else {
    return parserFlags.trim().split("\\s+");
  }
}
 
开发者ID:benblamey,项目名称:stanford-nlp,代码行数:9,代码来源:ParserAnnotator.java

示例6: GrammaticalRelation

public GrammaticalRelation(Language language,
                           String shortName,
                           String longName,
                           Class<? extends GrammaticalRelationAnnotation> annotation,
                           GrammaticalRelation parent,
                           String specificString) {
  this(language, shortName, longName, annotation, parent, null, null, StringUtils.EMPTY_STRING_ARRAY, specificString);
}
 
开发者ID:jaimeguzman,项目名称:data_mining,代码行数:8,代码来源:GrammaticalRelation.java

示例7: GrammaticalRelation

public GrammaticalRelation(Language language,
                           String shortName,
                           String longName,
                           Class<? extends GrammaticalRelationAnnotation> annotation,
                           GrammaticalRelation parent,
                           String specificString) {
  this(language, shortName, longName, annotation, parent, null, StringUtils.EMPTY_STRING_ARRAY, specificString);
}
 
开发者ID:chbrown,项目名称:stanford-parser,代码行数:8,代码来源:GrammaticalRelation.java

示例8: sisterSplitters

@Override
public String[] sisterSplitters() {
  return StringUtils.EMPTY_STRING_ARRAY;
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:4,代码来源:ChineseTreebankParserParams.java

示例9: init

void init(TaggerConfig config) {
  if (initted) return;  // TODO: why not reinit?

  this.config = config;

  String lang, arch;
  String[] openClassTags, closedClassTags;

  if (config == null) {
    lang = "english";
    arch = "left3words";
    openClassTags = StringUtils.EMPTY_STRING_ARRAY;
    closedClassTags = StringUtils.EMPTY_STRING_ARRAY;
    wordFunction = null;
  } else {
    this.VERBOSE = config.getVerbose();

    lang = config.getLang();
    arch = config.getArch();
    openClassTags = config.getOpenClassTags();
    closedClassTags = config.getClosedClassTags();
    if (!config.getWordFunction().equals("")) {
      wordFunction =
        ReflectionLoading.loadByReflection(config.getWordFunction());
    }

    if (((openClassTags.length > 0) && !lang.equals("")) || ((closedClassTags.length > 0) && !lang.equals("")) || ((closedClassTags.length > 0) && (openClassTags.length > 0))) {
      throw new RuntimeException("At least two of lang (\"" + lang + "\"), openClassTags (length " + openClassTags.length + ": " + Arrays.toString(openClassTags) + ")," +
          "and closedClassTags (length " + closedClassTags.length + ": " + Arrays.toString(closedClassTags) + ") specified---you must choose one!");
    } else if ((openClassTags.length == 0) && lang.equals("") && (closedClassTags.length == 0) && ! config.getLearnClosedClassTags()) {
      System.err.println("warning: no language set, no open-class tags specified, and no closed-class tags specified; assuming ALL tags are open class tags");
    }
  }

  if (openClassTags.length > 0) {
    tags = new TTags();
    tags.setOpenClassTags(openClassTags);
  } else if (closedClassTags.length > 0) {
    tags = new TTags();
    tags.setClosedClassTags(closedClassTags);
  } else {
    tags = new TTags(lang);
  }

  defaultScore = lang.equals("english") ? 1.0 : 0.0;

  if (config != null) {
    rareWordThresh = config.getRareWordThresh();
    minFeatureThresh = config.getMinFeatureThresh();
    curWordMinFeatureThresh = config.getCurWordMinFeatureThresh();
    rareWordMinFeatureThresh = config.getRareWordMinFeatureThresh();
    veryCommonWordThresh = config.getVeryCommonWordThresh();
    occurringTagsOnly = config.occurringTagsOnly();
    possibleTagsOnly = config.possibleTagsOnly();
    // System.err.println("occurringTagsOnly: "+occurringTagsOnly);
    // System.err.println("possibleTagsOnly: "+possibleTagsOnly);

    if(config.getDefaultScore() >= 0)
      defaultScore = config.getDefaultScore();
  }

  if (config == null || config.getMode() == TaggerConfig.Mode.TRAIN) {
    // initialize the extractors based on the arch variable
    // you only need to do this when training; otherwise they will be
    // restored from the serialized file
    extractors = new Extractors(ExtractorFrames.getExtractorFrames(arch));
    extractorsRare = new Extractors(ExtractorFramesRare.getExtractorFramesRare(arch, tags));

    setExtractorsGlobal();
  }

  ambClasses = new AmbiguityClasses(tags);

  initted = true;
}
 
开发者ID:benblamey,项目名称:stanford-nlp,代码行数:75,代码来源:MaxentTagger.java

示例10: init

void init(TaggerConfig config) {
  if (initted) return;  // TODO: why not reinit?

  this.config = config;

  String lang, arch;
  String[] openClassTags, closedClassTags;

  if (config == null) {
    lang = "english";
    arch = "left3words";
    openClassTags = StringUtils.EMPTY_STRING_ARRAY;
    closedClassTags = StringUtils.EMPTY_STRING_ARRAY;
    wordFunction = null;
  } else {
    this.VERBOSE = config.getVerbose();

    lang = config.getLang();
    arch = config.getArch();
    openClassTags = config.getOpenClassTags();
    closedClassTags = config.getClosedClassTags();
    if (!config.getWordFunction().equals("")) {
      wordFunction =
        ReflectionLoading.loadByReflection(config.getWordFunction());
    }

    if (((openClassTags.length > 0) && !lang.equals("")) || ((closedClassTags.length > 0) && !lang.equals("")) || ((closedClassTags.length > 0) && (openClassTags.length > 0))) {
      throw new RuntimeException("At least two of lang (\"" + lang + "\"), openClassTags (length " + openClassTags.length + ": " + Arrays.toString(openClassTags) + ")," +
          "and closedClassTags (length " + closedClassTags.length + ": " + Arrays.toString(closedClassTags) + ") specified---you must choose one!");
    } else if ((openClassTags.length == 0) && lang.equals("") && (closedClassTags.length == 0) && ! config.getLearnClosedClassTags()) {
      System.err.println("warning: no language set, no open-class tags specified, and no closed-class tags specified; assuming ALL tags are open class tags");
    }
  }

  if (openClassTags.length > 0) {
    tags = new TTags();
    tags.setOpenClassTags(openClassTags);
  } else if (closedClassTags.length > 0) {
    tags = new TTags();
    tags.setClosedClassTags(closedClassTags);
  } else {
    tags = new TTags(lang);
  }

  defaultScore = lang.equals("english") ? 1.0 : 0.0;

  if (config != null) {
    rareWordThresh = config.getRareWordThresh();
    minFeatureThresh = config.getMinFeatureThresh();
    curWordMinFeatureThresh = config.getCurWordMinFeatureThresh();
    rareWordMinFeatureThresh = config.getRareWordMinFeatureThresh();
    veryCommonWordThresh = config.getVeryCommonWordThresh();
    occurringTagsOnly = config.occurringTagsOnly();
    possibleTagsOnly = config.possibleTagsOnly();
    // System.err.println("occurringTagsOnly: "+occurringTagsOnly);
    // System.err.println("possibleTagsOnly: "+possibleTagsOnly);

    if(config.getDefaultScore() >= 0)
      defaultScore = config.getDefaultScore();
  }

  // just in case, reset the defaultScores array so it will be
  // recached later when needed.  can't initialize it now in case we
  // don't know ysize yet
  defaultScores = null;

  if (config == null || config.getMode() == TaggerConfig.Mode.TRAIN) {
    // initialize the extractors based on the arch variable
    // you only need to do this when training; otherwise they will be
    // restored from the serialized file
    extractors = new Extractors(ExtractorFrames.getExtractorFrames(arch));
    extractorsRare = new Extractors(ExtractorFramesRare.getExtractorFramesRare(arch, tags));

    setExtractorsGlobal();
  }

  ambClasses = new AmbiguityClasses(tags);

  initted = true;
}
 
开发者ID:jaimeguzman,项目名称:data_mining,代码行数:80,代码来源:MaxentTagger.java


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