* @return a Lucene <code>Analyzer</code>
* @throws IOException
*/
public static Analyzer buildAnalyzer(AnalyzerDef analyzerDef, Version luceneMatchVersion) throws IOException {
ResourceLoader defaultResourceLoader = new HibernateSearchResourceLoader();
TokenizerDef token = analyzerDef.tokenizer();
final Map<String, String> tokenMapsOfParameters = getMapOfParameters( token.params(), luceneMatchVersion );
TokenizerFactory tokenFactory = instanceFromClass( TokenizerFactory.class, token.factory(), "Tokenizer factory", tokenMapsOfParameters );
injectResourceLoader( tokenFactory, defaultResourceLoader, tokenMapsOfParameters );
final int length = analyzerDef.filters().length;
final int charLength = analyzerDef.charFilters().length;
TokenFilterFactory[] filters = new TokenFilterFactory[length];