use std::collections::HashMap;
use std::ops::{Deref, DerefMut};

use analysis::AnalyzerSpec;
use analysis::tokenizers::TokenizerSpec;
use analysis::filters::FilterSpec;


#[derive(Debug)]
pub struct AnalyzerRegistry {
    analyzers: HashMap<String, AnalyzerSpec>,
    tokenizers: HashMap<String, TokenizerSpec>,
    filters: HashMap<String, FilterSpec>,
}


impl AnalyzerRegistry {
    pub fn new() -> AnalyzerRegistry {
        AnalyzerRegistry {
            analyzers: HashMap::new(),
            tokenizers: HashMap::new(),
            filters: HashMap::new(),
        }
    }
}


impl Deref for AnalyzerRegistry {
    type Target = HashMap<String, AnalyzerSpec>;

    fn deref(&self) -> &HashMap<String, AnalyzerSpec> {
        &self.analyzers
    }
}


impl DerefMut for AnalyzerRegistry {
    fn deref_mut(&mut self) -> &mut HashMap<String, AnalyzerSpec> {
        &mut self.analyzers
    }
}

use std::collections::HashMap;
use std::ops::{Deref, DerefMut};

use analysis::Analyzer;
use analysis::tokenizers::TokenizerSpec;
use analysis::filters::FilterSpec;


#[derive(Debug)]
pub struct AnalyzerRegistry {
    analyzers: HashMap<String, Analyzer>,
    tokenizers: HashMap<String, TokenizerSpec>,
    filters: HashMap<String, FilterSpec>,
}


impl AnalyzerRegistry {
    pub fn new() -> AnalyzerRegistry {
        AnalyzerRegistry {
            analyzers: HashMap::new(),
            tokenizers: HashMap::new(),
            filters: HashMap::new(),
        }
    }
}


impl Deref for AnalyzerRegistry {
    type Target = HashMap<String, Analyzer>;

    fn deref(&self) -> &HashMap<String, Analyzer> {
        &self.analyzers
    }
}


impl DerefMut for AnalyzerRegistry {
    fn deref_mut(&mut self) -> &mut HashMap<String, Analyzer> {
        &mut self.analyzers
    }
}

--- 
+++ 
@@ -1,14 +1,14 @@
 use std::collections::HashMap;
 use std::ops::{Deref, DerefMut};
 
-use analysis::Analyzer;
+use analysis::AnalyzerSpec;
 use analysis::tokenizers::TokenizerSpec;
 use analysis::filters::FilterSpec;
 
 
 #[derive(Debug)]
 pub struct AnalyzerRegistry {
-    analyzers: HashMap<String, Analyzer>,
+    analyzers: HashMap<String, AnalyzerSpec>,
     tokenizers: HashMap<String, TokenizerSpec>,
     filters: HashMap<String, FilterSpec>,
 }
@@ -26,16 +26,16 @@
 
 
 impl Deref for AnalyzerRegistry {
-    type Target = HashMap<String, Analyzer>;
+    type Target = HashMap<String, AnalyzerSpec>;
 
-    fn deref(&self) -> &HashMap<String, Analyzer> {
+    fn deref(&self) -> &HashMap<String, AnalyzerSpec> {
         &self.analyzers
     }
 }
 
 
 impl DerefMut for AnalyzerRegistry {
-    fn deref_mut(&mut self) -> &mut HashMap<String, Analyzer> {
+    fn deref_mut(&mut self) -> &mut HashMap<String, AnalyzerSpec> {
         &mut self.analyzers
     }
 }
Use new AnalyzerSpec in AnalyzerRegistry
