[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new-flex-completion-style
From: |
João Távora |
Subject: |
Re: new-flex-completion-style |
Date: |
Thu, 14 Feb 2019 14:59:59 +0000 |
On Thu, Feb 14, 2019 at 1:55 PM João Távora <address@hidden> wrote:
>
> On Thu, Feb 14, 2019 at 1:36 PM Stefan Monnier <address@hidden> wrote:
> >
> > > I don't think it's odd. I call the former "scattered match"
> > > and the latter a "tighter match".
> >
> > Don't you find it odd that "foo" gives a better score to
> > "fotttttttttttttttto" than to "foto" ?
>
> Perhaps. But as it stands it doesn't make sense to
> compare scores across different length strings.
>
> It does make sense to compare the score between
> foo's matches of foot and foto.
>
> > [ Given them the same score sounds acceptable, tho. ]
>
> Feel free to add some kind of normalization to the function
> if you can come up with it. Or come up with another function
> entirely. As I said, a function that measures the distance
> in "boring editing operations" between the pattern and the target
> would be a nicer measure.
I've been experimenting with a simpler function that just counts the
number of "holes" and the length of those holes separately
in the denominator. The numerator is the same and a perfect
match is still a 1. It seems to fare better for your cases. For foo
Eventually we could weight the number and length
of holes differently so we can get this:
score(foo,barfoobaz) > score(foo,fabrobazo) >
score(foo,fotttttttttttttttttttttto)
Which would be nicer, I think.
João
- RE: new-flex-completion-style, (continued)
Re: new-flex-completion-style, Stefan Monnier, 2019/02/12
- Re: new-flex-completion-style, João Távora, 2019/02/12
- Re: new-flex-completion-style, João Távora, 2019/02/13
- Re: new-flex-completion-style, Stefan Monnier, 2019/02/13
- Re: new-flex-completion-style, João Távora, 2019/02/13
- Re: new-flex-completion-style, Stefan Monnier, 2019/02/14
- Re: new-flex-completion-style, João Távora, 2019/02/14
- Re: new-flex-completion-style,
João Távora <=
- Re: new-flex-completion-style, Óscar Fuentes, 2019/02/14
- RE: new-flex-completion-style, Drew Adams, 2019/02/14
- Re: new-flex-completion-style, João Távora, 2019/02/14
Re: new-flex-completion-style, Daniel Pittman, 2019/02/14
Re: new-flex-completion-style, João Távora, 2019/02/14
Re: new-flex-completion-style, João Távora, 2019/02/14
RE: new-flex-completion-style, Drew Adams, 2019/02/14
Re: new-flex-completion-style, João Távora, 2019/02/14
RE: new-flex-completion-style, Drew Adams, 2019/02/14
Re: new-flex-completion-style, João Távora, 2019/02/14