Skip to content

Found a bug in file dict_util.go #173

@ntcat

Description

@ntcat

in this func:
func (seg *Segmenter) Reader(reader *bufio.Reader, files ...string) error

those code lines:
if fsErr != nil {
if fsErr == io.EOF {
...
}
must put after :
...
seg.Dict.AddToken(token)
Otherwise,last line of dictory file will be missed.exclude the last line is empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions