コード例 #1
0
        private void InitializeSearchEngine()
        {
            logger.Trace("Initializing search engine");
            var stopwords = ResourceExtensions.GetResource(stopwords_filename);

            search_engine.Initialize(stopwords);
        }
コード例 #2
0
        private void InitializeSpellChecker()
        {
            logger.Trace("Initializing spell checker");
            var en_aff      = ResourceExtensions.GetResource(aff_filename);
            var en_aff_data = Encoding.ASCII.GetBytes(en_aff);
            var en_dic      = ResourceExtensions.GetResource(dic_filename);
            var en_dic_data = Encoding.ASCII.GetBytes(en_dic);

            SpellChecker.Default.HunspellInstance = new Hunspell(en_aff_data, en_dic_data);
        }
コード例 #3
0
        public object Get(string id = null)
        {
            if (String.IsNullOrEmpty(id))
            {
                id = "index.html";
            }
            var stream = ResourceExtensions.GetResource(id);


            if (stream == null)
            {
                return(NotFound());
            }

            var response = new HttpResponseMessage()
            {
                Content = new StreamContent(stream),
            };

            //response.Headers.Add("Content-Type",new string[] { GetMedia(id) });
            return(response);
        }