public void PASS_Create()
        {
            StemmerTokenFilter filter = new StemmerTokenFilter("name", StemmerLanguageEnum.MinimalEnglish)
            {
                Version = 2.4
            };

            Assert.IsNotNull(filter);
            Assert.AreEqual("name", filter.Name);
            Assert.AreEqual(2.4, filter.Version);
            Assert.AreEqual(StemmerLanguageEnum.MinimalEnglish, filter.Language);
        }
        public void PASS_Serialize()
        {
            StemmerTokenFilter filter = new StemmerTokenFilter("name", StemmerLanguageEnum.MinimalEnglish)
            {
                Version = 2.4
            };

            string json = JsonConvert.SerializeObject(filter);
            Assert.IsNotNull(json);

            string expectedJson = "{\"name\":{\"type\":\"stemmer\",\"version\":2.4,\"language\":\"minimal_english\"}}";
            Assert.AreEqual(expectedJson, json);
        }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            Dictionary<string, object> filterDict = serializer.Deserialize<Dictionary<string, object>>(reader);
            Dictionary<string, object> fieldDict = JsonConvert.DeserializeObject<Dictionary<string, object>>(filterDict.First().Value.ToString());

            StemmerLanguageEnum language = StemmerLanguageEnum.MinimalEnglish;
            if(fieldDict.ContainsKey(_LANGUAGE))
            {
                language = StemmerLanguageEnum.Find(fieldDict.GetString(_LANGUAGE));
            }
            else if(fieldDict.ContainsKey(_NAME))
            {
                language = StemmerLanguageEnum.Find(fieldDict.GetString(_NAME));
            }
            else
            {
                throw new RequiredPropertyMissingException(_LANGUAGE + "/" + _NAME);
            }            

            StemmerTokenFilter filter = new StemmerTokenFilter(filterDict.First().Key, language);
            TokenFilterBase.Deserialize(filter, fieldDict);

            return filter;
        }