|
@@ -1,8 +1,13 @@
|
|
|
package org.diagbot.push.controller;
|
|
|
|
|
|
+import org.diagbot.nlp.participle.ParticipleUtil;
|
|
|
+import org.diagbot.pub.api.Response;
|
|
|
import org.diagbot.pub.web.BaseController;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+
|
|
|
+import java.io.IOException;
|
|
|
|
|
|
@Controller
|
|
|
@RequestMapping("/participle")
|
|
@@ -14,4 +19,15 @@ public class ParticipleController extends BaseController {
|
|
|
public String index() {
|
|
|
return listView;
|
|
|
}
|
|
|
+
|
|
|
+ @ResponseBody
|
|
|
+ @RequestMapping("/split_and_highlight")
|
|
|
+ public Response splitAndHighlight(String content) throws IOException {
|
|
|
+ Response response = new Response();
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ response.setData(ParticipleUtil.participleAndHighlight(content));
|
|
|
+ long end = System.currentTimeMillis();
|
|
|
+ System.out.println("总耗时:........." + (end - start));
|
|
|
+ return response;
|
|
|
+ }
|
|
|
}
|