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();}}

public static Analyzer CreateAnalyzer(string className){Type clazz = Type.GetType(className);try{return (Analyzer)Activator.CreateInstance(clazz,#pragma warning disable 612, 618LuceneVersion.LUCENE_CURRENT);#pragma warning restore 612, 618}catch (MissingMethodException ){return (Analyzer)Activator.CreateInstance(clazz);}}
