Skip to content

Commit

Permalink
textsplitter: remove wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
tmc committed Feb 20, 2024
1 parent ba73dea commit 3f4ee00
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions textsplitter/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func DefaultOptions() Options {
ChunkSize: _defaultTokenChunkSize,
ChunkOverlap: _defaultTokenChunkOverlap,
Separators: []string{"\n\n", "\n", " ", ""},
LenFunc: defaultLenFunc,
LenFunc: utf8.RuneCountInString,

ModelName: _defaultTokenModelName,
EncodingName: _defaultTokenEncoding,
Expand Down Expand Up @@ -118,7 +118,3 @@ func WithReferenceLinks(referenceLinks bool) Option {
o.ReferenceLinks = referenceLinks
}
}

func defaultLenFunc(s string) int {
return utf8.RuneCountInString(s)
}

0 comments on commit 3f4ee00

Please sign in to comment.