Skip to content

Commit

Permalink
Fixed some typo and Update .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
vcaesar committed Oct 6, 2021
1 parent 655a68a commit 8ed9992
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

examples/examples
examples/test.blv
test.blv

# Binaries for programs and plugins
*.exe
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
func main() {
opt := gse.Option{
Index: "test.blv",
Dicts: "emend, zh", Stop: "",
Dicts: "embed, zh", Stop: "",
Opt: "search-hmm", Trim: "trim"}

index, err := gse.New(opt)
Expand Down
8 changes: 4 additions & 4 deletions bleve.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ func NewGse(dicts, stop, opt, trim string, alpha bool) (*GseCut, error) {
dicts = "zh"
}

if strings.Contains(dicts, "emend") {
dicts = strings.Replace(dicts, "emend, ", "", 1)
if strings.Contains(dicts, "embed") {
dicts = strings.Replace(dicts, "embed, ", "", 1)
err = seg.LoadDictEmbed(dicts)
} else {
err = seg.LoadDict(dicts)
}

if stop != "" {
if strings.Contains(stop, "emend") {
stop = strings.Replace(stop, "emend, ", "", 1)
if strings.Contains(stop, "embed") {
stop = strings.Replace(stop, "embed, ", "", 1)
seg.LoadStopEmbed(stop)
} else {
seg.LoadStop(stop)
Expand Down
2 changes: 1 addition & 1 deletion examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
func main() {
opt := gse.Option{
Index: "test.blv",
Dicts: "emend, zh", Stop: "",
Dicts: "embed, zh", Stop: "",
Opt: "search-hmm", Trim: "trim"}

index, err := gse.New(opt)
Expand Down

0 comments on commit 8ed9992

Please sign in to comment.