Skip to content

search mode return empty slice #199

@yangglive

Description

@yangglive
package main

import (
	"fmt"

	"github.com/go-ego/gse"
)

func main() {
	var seg gse.Segmenter
	seg, _ = gse.New("./data/dict/zh/s_1.txt,./data/dict/zh/user.txt")
	segments := seg.Slice("hello", true)
	fmt.Println("segments", segments)
	segments = seg.Slice("hello", false)
	fmt.Println("segments", segments)
}
2025/12/04 16:38:48 Dict files path:  [./data/dict/zh/s_1.txt ./data/dict/zh/user.txt]
2025/12/04 16:38:48 Load the gse dictionary: "./data/dict/zh/s_1.txt" 
2025/12/04 16:38:49 Load the gse dictionary: "./data/dict/zh/user.txt" 
2025/12/04 16:38:49 Gse dictionary loaded finished.
segments []
segments [hello]

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