Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dictbuilder #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions dictionary/dicbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (
StringUtf8MaxLength = 32767
StringUtf16MaxLength = 32767
ArrayMaxLength = 127
NumberOfColumns = 18
NumberOfColumns = 19
BufferSize = 1024 * 1024
)

Expand Down Expand Up @@ -255,13 +255,13 @@ type writeStringFunc func(buffer *bytes.Buffer, s string) error
type stringLenFunc func(s string) bool

type DictionaryBuilder struct {
trieKeys *redblacktree.Tree
wordEntries []*wordEntry
buffer *bytes.Buffer
position int64
systemLexicon *DoubleArrayLexicon
writeStringF writeStringFunc
stringLen stringLenFunc
trieKeys *redblacktree.Tree
wordEntries []*wordEntry
buffer *bytes.Buffer
position int64
systemLexicon *DoubleArrayLexicon
writeStringF writeStringFunc
stringLen stringLenFunc
}

func NewDictionaryBuilder(position int64, systemLexicon *DoubleArrayLexicon, utf16string bool) *DictionaryBuilder {
Expand All @@ -280,9 +280,9 @@ func NewDictionaryBuilder(position int64, systemLexicon *DoubleArrayLexicon, utf
}
return len(l) - len(r)
}),
systemLexicon: systemLexicon,
buffer: bytes.NewBuffer([]byte{}),
position: position,
systemLexicon: systemLexicon,
buffer: bytes.NewBuffer([]byte{}),
position: position,
}
if utf16string {
ret.writeStringF = writeStringUtf16
Expand Down