public void ProcessRequest(HttpContext context)
        {
            try
            {
                #region [.anti-bot.]
                var antiBot = context.ToAntiBot();
                if (antiBot.IsNeedRedirectOnCaptchaIfRequestNotValid())
                {
                    antiBot.SendGotoOnCaptchaJsonResponse();
                    return;
                }
                #endregion

                var text          = context.GetRequestStringParam("text", Config.MAX_INPUTTEXT_LENGTH);
                var splitBySmiles = context.Request["splitBySmiles"].Try2Boolean(true);
                var html          = context.Request["html"].Try2Boolean(false);

                #region [.anti-bot.]
                antiBot.MarkRequestEx(text);
                #endregion

                var hcd   = new http_context_data(context);
                var words = hcd.GetConcurrentFactory().Run(text, splitBySmiles);

                SendJsonResponse(context, words, text, html);
            }
            catch (Exception ex)
            {
                SendJsonResponse(context, ex);
            }
        }
Exemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                var text    = context.GetRequestStringParam("text", Config.MAX_INPUTTEXT_LENGTH);
                var hcd     = new http_context_data(context);
                var factory = hcd.GetConcurrentFactory();

                var urls = factory.Run(text);

                SendJsonResponse(context, urls);
            }
            catch (Exception ex)
            {
                SendJsonResponse(context, ex);
            }
        }
Exemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                var text          = context.GetRequestStringParam("text", Config.MAX_INPUTTEXT_LENGTH);
                var splitBySmiles = context.Request["splitBySmiles"].Try2Boolean(true);
                var returnText    = context.Request["returnText"].Try2Boolean(true);

                var hcd   = new http_context_data(context);
                var sents = hcd.GetConcurrentFactory().AllocateSents(text, splitBySmiles);

                SendJsonResponse(context, sents, text, returnText);
            }
            catch (Exception ex)
            {
                SendJsonResponse(context, ex);
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                var text = context.Request["text"];

                var hcd     = new http_context_data(context);
                var factory = hcd.GetConcurrentFactory();

                var ips = factory.Run(text);

                SendJsonResponse(context, ips);
            }
            catch (Exception ex)
            {
                SendJsonResponse(context, ex);
            }
        }