use of edu.stanford.nlp.trees.SemanticHeadFinder in project CoreNLP by stanfordnlp.
the class Preferences method lookupHeadFinder.
static HeadFinder lookupHeadFinder(String headfinderName) {
if (headfinderName.equalsIgnoreCase("ArabicHeadFinder")) {
return new ArabicHeadFinder();
} else if (headfinderName.equalsIgnoreCase("BikelChineseHeadFinder")) {
return new BikelChineseHeadFinder();
} else if (headfinderName.equalsIgnoreCase("ChineseHeadFinder")) {
return new ChineseHeadFinder();
} else if (headfinderName.equalsIgnoreCase("ChineseSemanticHeadFinder")) {
return new ChineseSemanticHeadFinder();
} else if (headfinderName.equalsIgnoreCase("CollinsHeadFinder")) {
return new CollinsHeadFinder();
} else if (headfinderName.equalsIgnoreCase("DybroFrenchHeadFinder")) {
return new DybroFrenchHeadFinder();
} else if (headfinderName.equalsIgnoreCase("LeftHeadFinder")) {
return new LeftHeadFinder();
} else if (headfinderName.equalsIgnoreCase("ModCollinsHeadFinder")) {
return new ModCollinsHeadFinder();
} else if (headfinderName.equalsIgnoreCase("NegraHeadFinder")) {
return new NegraHeadFinder();
} else if (headfinderName.equalsIgnoreCase("SemanticHeadFinder")) {
return new SemanticHeadFinder();
} else if (headfinderName.equalsIgnoreCase("SunJurafskyChineseHeadFinder")) {
return new SunJurafskyChineseHeadFinder();
} else if (headfinderName.equalsIgnoreCase("TueBaDZHeadFinder")) {
return new TueBaDZHeadFinder();
} else if (headfinderName.equalsIgnoreCase("UniversalSemanticHeadFinder")) {
return new UniversalSemanticHeadFinder();
} else {
//try to find the class
try {
Class<?> headfinder = Class.forName(headfinderName);
HeadFinder hf = (HeadFinder) headfinder.newInstance();
return hf;
} catch (Exception e) {
return null;
}
}
}
Aggregations