本文整理汇总了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);
}
示例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);
}
示例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;
}
示例4: wsvStringToStringArray
private static String[] wsvStringToStringArray(String str) {
if (str == null || str.equals("")) {
return StringUtils.EMPTY_STRING_ARRAY;
} else {
return str.split("\\s+");
}
}
示例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+");
}
}
示例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);
}
示例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);
}
示例8: sisterSplitters
@Override
public String[] sisterSplitters() {
return StringUtils.EMPTY_STRING_ARRAY;
}
示例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;
}
示例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;
}