Revise ranking algorithm

This commit is contained in:
Junegunn Choi
2016-09-07 09:58:18 +09:00
parent 8ef2420677
commit 2fc7c18747
20 changed files with 961 additions and 460 deletions

View File

@@ -143,8 +143,8 @@ func Run(opts *Options) {
}
patternBuilder := func(runes []rune) *Pattern {
return BuildPattern(
opts.Fuzzy, opts.Extended, opts.Case, forward, opts.Filter == nil,
opts.Nth, opts.Delimiter, runes)
opts.Fuzzy, opts.FuzzyAlgo, opts.Extended, opts.Case, forward,
opts.Filter == nil, opts.Nth, opts.Delimiter, runes)
}
matcher := NewMatcher(patternBuilder, sort, opts.Tac, eventBox)
@@ -158,11 +158,12 @@ func Run(opts *Options) {
found := false
if streamingFilter {
slab := util.MakeSlab(slab16Size, slab32Size)
reader := Reader{
func(runes []byte) bool {
item := chunkList.trans(runes, 0)
if item != nil {
if result, _ := pattern.MatchItem(item); result != nil {
if result, _, _ := pattern.MatchItem(item, false, slab); result != nil {
fmt.Println(item.text.ToString())
found = true
}