Class SegmentController

java.lang.Object
com.bytedesk.ai.segment.SegmentController

@RestController @RequestMapping("/segment/api/v1") @ConditionalOnProperty(prefix="bytedesk", name="debug", havingValue="true", matchIfMissing=false) public class SegmentController extends Object
测试分词控制器,上线可注释掉 https://github.com/houbb/segment?tab=readme-ov-file
Author:
jackning
  • Field Details

  • Constructor Details

    • SegmentController

      public SegmentController()
  • Method Details

    • segmentWords

      @GetMapping("/words") public org.springframework.http.ResponseEntity<?> segmentWords(@RequestParam String text)
    • segmentDetails

      @GetMapping("/details") public org.springframework.http.ResponseEntity<?> segmentDetails(@RequestParam String text)
    • wordCount

      @GetMapping("/count") public org.springframework.http.ResponseEntity<?> wordCount(@RequestParam String text)
    • segment

      @PostMapping("/segment") public org.springframework.http.ResponseEntity<?> segment(@Valid @RequestBody @Valid SegmentRequest request)
    • batchSegment

      @GetMapping("/batch") public org.springframework.http.ResponseEntity<?> batchSegment(@RequestBody List<String> texts, @RequestParam(defaultValue="word") String type)
    • simpleSegment

      @GetMapping("/simple") public org.springframework.http.ResponseEntity<?> simpleSegment(@RequestParam String text, @RequestParam(defaultValue="false") Boolean filterPunctuation, @RequestParam(defaultValue="1") Integer minLength)