Ejemplo n.º 1
0
        public string gettxt3(string postStr)
        {
            string       word = "";
            String       text = postStr.Trim();;
            Analyzer     anal = new PanGuAnalyzer();//使用盘古分词
            StringReader sb   = new StringReader(text);
            TokenStream  ts   = anal.ReusableTokenStream("", sb);
            Token        t    = null;

            word = "select top 1 Content from tb_U_Message where 1=1";
            while ((t = ts.Next()) != null)
            {
                Console.WriteLine(t.TermText());
                // Response.Write(t.TermText());
                word += "and Title like'%" + t.TermText() + "%'"; //and Title like'%"+t.TermText()+"%'
            }


            string count = HXD.DBUtility.SQLHelper.ExecuteScalar(word).ToString();

            Repeater += "<MsgType><![CDATA[text]]></MsgType>";
            Repeater += "<Content><![CDATA[" + count + "\n\n如词答案任没有解决您的问题,你可以点击直接询问我们在泰国的达人。]]></Content>";



            return(Repeater);
        }
Ejemplo n.º 2
0
        //
        // GET: /Test/
        public ActionResult Index()
        {
            PanGuAnalyzer analyzer = new PanGuAnalyzer();
            TokenStream   ts       = analyzer.ReusableTokenStream("", new StringReader("供应子母门 非标门 钢质门 进户门 金属门"));
            Token         token;

            while ((token = ts.Next()) != null)
            {
                Response.Write(token.TermText() + ";");
            }
            return(View());
        }