From: Wang YanQing <udknight@gmail.com>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Jean Delvare <jdelvare@suse.de>, Michal Marek <mmarek@suse.cz>,
Roland Eggner <edvx1@systemanalysen.net>
Subject: Re: [PATCH v3] kconfig: sort found symbols by relevance
Date: Thu, 9 May 2013 23:27:31 +0800 [thread overview]
Message-ID: <20130509152731.GA3355@udknight> (raw)
In-Reply-To: <1367874931-6251-1-git-send-email-yann.morin.1998@free.fr>
On Mon, May 06, 2013 at 11:15:31PM +0200, Yann E. MORIN wrote:
> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
> When searching for symbols, return the symbols sorted by relevance.
>
> Sorting is done as thus:
> - first, symbols with a prompt, [1]
> - then, smallest offset, [2]
> - then, shortest match, [3]
> - then, highest relative match, [4]
> - finally, alphabetical sort [5]
>
> So, searching (eg.) for 'P.*CI' :
>
> [1] Symbols of interest are probably those with a prompt, as they can be
> changed, while symbols with no prompt are only for info. Thus:
> PCIEASPM comes before PCI_ATS
Search the value of symbols with no prompt are useful too
> [2] Symbols that match earlier in the name are to be preferred over
> symbols which match later. Thus:
> PCI_MSI comes before WDTPCI
We can achieve this with ^PCI regular search
> [3] The shortest match is (IMHO) more interesting than a longer one.
> Thus:
> PCI comes before PCMCIA
We can achieve this with ^PCI regular search plus your previous heuristic
> [4] The relative match is the ratio of the length of the match against
> the length of the symbol. The more of a symbol name we match, the
> more instersting that symbol is. Thus:
> PCIEAER comes before PCIEASPM
This is what your first heuristic
> [5] As fallback, sort symbols alphabetically
This is in your first heuristic too.
> This heuristic tries hard to get interesting symbols first in the list.
I don't mean your this heuristic is bad, but
maybe provide mechanism to user will make guesser life easier.
Thanks.
next prev parent reply other threads:[~2013-05-09 15:27 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-06 7:50 Wish: exact matches displayed first Jean Delvare
2013-05-06 10:00 ` Yann E. MORIN
2013-05-06 12:54 ` Yann E. MORIN
2013-05-06 13:04 ` Thomas Petazzoni
2013-05-06 13:53 ` Yann E. MORIN
2013-05-06 14:19 ` Jean Delvare
2013-05-06 14:27 ` Yann E. MORIN
2013-05-06 14:36 ` Jean Delvare
2013-05-06 14:10 ` Jean Delvare
2013-05-06 13:02 ` [PATCH] kconfig: sort found symbols by relevance Yann E. MORIN
2013-05-06 15:28 ` Jean Delvare
2013-05-06 18:17 ` Yann E. MORIN
2013-05-07 1:35 ` Wang YanQing
2013-05-06 18:20 ` Yann E. MORIN
2013-05-06 19:36 ` Yann E. MORIN
2013-05-06 21:15 ` [PATCH v3] " Yann E. MORIN
2013-05-09 15:27 ` Wang YanQing [this message]
2013-05-09 16:12 ` Yann E. MORIN
2013-05-10 0:51 ` Wang YanQing
2013-05-10 10:12 ` Yann E. MORIN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130509152731.GA3355@udknight \
--to=udknight@gmail.com \
--cc=edvx1@systemanalysen.net \
--cc=jdelvare@suse.de \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=yann.morin.1998@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.