text: public static final Analyzer createAnalyzer(String className) throws Exception{final Class<? extends Analyzer> clazz = Class.forName(className).asSubclass(Analyzer.class);try {Constructor<? extends Analyzer> cnstr = clazz.getConstructor(Version.class);return cnstr.newInstance(Version.LATEST);} catch (NoSuchMethodException nsme) {return clazz.getConstructor().newInstance();}}