public void PASS_Serialize()
        {
            StandardAnalyzer analyzer = new StandardAnalyzer("name")
            {
                Version = 4.6,
                MaximumTokenLength = 25,
                Stopwords = new List<string>() { "stop1", "stop2" },
                Aliases = new List<string>() { "alias1", "alias2" }
            };

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

            string expectedJson = "{\"name\":{\"type\":\"standard\",\"version\":4.6,\"aliases\":[\"alias1\",\"alias2\"],\"stopwords\":[\"stop1\",\"stop2\"],\"max_token_length\":25}}";
            Assert.AreEqual(expectedJson, json);
        }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            Dictionary<string, object> analyzerDict = serializer.Deserialize<Dictionary<string, object>>(reader);
            Dictionary<string, object> fieldDict = JsonConvert.DeserializeObject<Dictionary<string, object>>(analyzerDict.First().Value.ToString());

            StandardAnalyzer analyzer = new StandardAnalyzer(analyzerDict.First().Key);
            AnalyzerBase.Deserialize(analyzer, fieldDict);

            if (fieldDict.ContainsKey(_STOPWORDS))
            {
                analyzer.Stopwords = JsonConvert.DeserializeObject<IEnumerable<string>>(fieldDict.GetString(_STOPWORDS));
            }

            analyzer.MaximumTokenLength = fieldDict.GetInt32(_MAXIMUM_TOKEN_LENGTH, StandardAnalyzer._MAXIMUM_TOKEN_LENGTH_DEFAULT);

            return analyzer;
        }
        public void PASS_Create()
        {
            StandardAnalyzer analyzer = new StandardAnalyzer("name")
            {
                Version = 4.6,
                MaximumTokenLength = 25,
                Stopwords = new List<string>() { "stop1", "stop2" },
                Aliases = new List<string>() { "alias1", "alias2" }
            };

            Assert.IsNotNull(analyzer);
            Assert.AreEqual("name", analyzer.Name);
            Assert.AreEqual(4.6, analyzer.Version);
            Assert.AreEqual(25, analyzer.MaximumTokenLength);
            Assert.AreEqual("stop1", analyzer.Stopwords.First());
            Assert.AreEqual("stop2", analyzer.Stopwords.Last());
            Assert.AreEqual("alias1", analyzer.Aliases.First());
            Assert.AreEqual("alias2", analyzer.Aliases.Last());
        }