* @param luceneMatchVersion The lucene version (required since Lucene 3.x)
*
* @return a Lucene <code>Analyzer</code>
*/
public static Analyzer buildAnalyzer(AnalyzerDef analyzerDef, Version luceneMatchVersion) {
ResourceLoader defaultResourceLoader = new HibernateSearchResourceLoader();
TokenizerDef token = analyzerDef.tokenizer();
TokenizerFactory tokenFactory = instanceFromClass( TokenizerFactory.class, token.factory(), "Tokenizer factory" );
final Map<String, String> tokenMapsOfParameters = getMapOfParameters( token.params(), luceneMatchVersion );
tokenFactory.init( tokenMapsOfParameters );
injectResourceLoader( tokenFactory, defaultResourceLoader, tokenMapsOfParameters );