代码如下:

import com.huaban.analysis.jieba.{JiebaSegmenter, SegToken}
import java.util.List

object JiebaUtil {
  val jiebaSegmenter = new JiebaSegmenter

  def getSegList(query: String): List[SegToken] = {
    jiebaSegmenter.process(query, JiebaSegmenter.SegMode.SEARCH)
  }
}