private LuceneDeployment[] GetAnalyzers(Hashtable analyzers) { LuceneDeployment[] deployments = new LuceneDeployment[analyzers.Count]; IDictionaryEnumerator enu = analyzers.GetEnumerator(); int index = 0; while (enu.MoveNext()) { deployments[index] = new LuceneDeployment(); deployments[index] = (LuceneDeployment)enu.Value; index++; } return(deployments); }
public Hashtable GetProvider(LuceneDeployment[] prov, System.Reflection.Assembly asm) { Hashtable hash = new Hashtable(); LuceneDeployment provider = new LuceneDeployment(); provider.AssemblyName = asm.ToString(); provider.ClassName = Class; provider.FileName = asm.ManifestModule.Name; provider.Name = Name; if (prov != null) { hash = ProviderToHashtable(prov); } if (hash.Contains(provider.Name)) { throw new Exception("Analyzer with the same name already exists"); } hash[provider.Name] = provider; return(hash); }
private Hashtable GetProvider(LuceneDeployment[] prov, FileInfo fInfo) { Hashtable hash = new Hashtable(); LuceneDeployment provider = new LuceneDeployment(); provider.Name = Name; provider.FileName = fInfo.Name; if (prov != null) { hash = ProviderToHashTable(prov); } if (hash.Contains(provider.Name)) { throw new Exception("Pattern with the same name already exists"); } if (LuceneUtil.Providers.IsPreDefined(provider.Name, LuceneUtil.Providers.Type.Pattern)) { throw new Exception("Pattern name specified is invalid"); } hash[provider.Name] = provider; return(hash); }