1 Star 0 Fork 0

bit212/segment

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
export_test.go 415 Bytes
一键复制 编辑 原始数据 按行查看 历史
Marty Schoch 提交于 2014-10-17 04:43 +08:00 . improving test coverage
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package segment
// Exported for testing only.
import (
"unicode/utf8"
)
func (s *Segmenter) MaxTokenSize(n int) {
if n < utf8.UTFMax || n > 1e9 {
panic("bad max token size")
}
if n < len(s.buf) {
s.buf = make([]byte, n)
}
s.maxTokenSize = n
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bit212/segment.git
git@gitee.com:bit212/segment.git
bit212
segment
segment
master

搜索帮助