public void PASS_Serialize()
        {
            StemmerOverrideTokenFilter filter = new StemmerOverrideTokenFilter("name")
            {
                Version = 2.4,
                Rules = new List<string>() { "rule1", "rule2" },
                RulesPath = "path/rules"
            };

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

            string expectedJson = "{\"name\":{\"type\":\"stemmer_override\",\"version\":2.4,\"rules\":[\"rule1\",\"rule2\"],\"rules_path\":\"path/rules\"}}";
            Assert.AreEqual(expectedJson, json);
        }
        public void PASS_Create()
        {
            StemmerOverrideTokenFilter filter = new StemmerOverrideTokenFilter("name")
            {
                Version = 2.4,
                Rules = new List<string>() { "rule1", "rule2" },
                RulesPath = "path/rules"
            };

            Assert.IsNotNull(filter);
            Assert.AreEqual("name", filter.Name);
            Assert.AreEqual(2.4, filter.Version);
            Assert.AreEqual("rule1", filter.Rules.First());
            Assert.AreEqual("rule2", filter.Rules.Last());
            Assert.AreEqual("path/rules", filter.RulesPath);
        }
        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());            

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

            if (fieldDict.ContainsKey(_RULES))
            {
                filter.Rules = JsonConvert.DeserializeObject<IEnumerable<string>>(fieldDict.GetString(_RULES));
            }
            filter.RulesPath = fieldDict.GetStringOrDefault(_RULES_PATH);

            return filter;
        }