Skip to content

Commit

Permalink
add new textspliter option: lenfunc
Browse files Browse the repository at this point in the history
  • Loading branch information
whyiug committed Feb 11, 2024
1 parent 8734b60 commit a63d3a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions textsplitter/recursive_character_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ func TestRecursiveCharacterSplitter(t *testing.T) {
}
testCases := []testCase{
{
text: "哈里森\n很高兴遇见你\n欢迎你来中国",
text: "哈里森\n很高兴遇见你\n欢迎来中国",
chunkOverlap: 0,
chunkSize: 10,
separators: []string{"\n\n", "\n", " "},
lenFunc: utf8.RuneCountInString,
expectedDocs: []schema.Document{
{PageContent: "哈里森\n很高兴遇见你", Metadata: map[string]any{}},
{PageContent: "欢迎你来中国", Metadata: map[string]any{}},
{PageContent: "欢迎来中国", Metadata: map[string]any{}},
},
},
{
Expand Down

0 comments on commit a63d3a9

Please sign in to comment.