code: public static Analyzer getAnalyzer(String className) throws Exception {
  
          Analyzer analyzer = null;
          Class<?> analyzerClass;
          try {
              analyzerClass = Class.forName(className);
          } catch (ClassNotFoundException e) {
              // allow Lucene standard classes to be written in a short form
              analyzerClass = Class.forName(LUCENE_ANALYZER + className);
          }
  
          // since Lucene 3.0 most analyzers need a "version" parameter and don't support an empty constructor
          if (StandardAnalyzer.class.equals(analyzerClass)) {
              // the Lucene standard analyzer is used - but without any stopwords.
              analyzer = new StandardAnalyzer(new CharArraySet(0, false));
          } else {
              analyzer = (Analyzer)analyzerClass.newInstance();
          }
          return analyzer;
      }
docs: Returns an analyzer for the given class name.<p>
  
  @param className the class name of the analyzer
  
  @return the appropriate lucene analyzer
  
  @throws Exception if something goes wrong