On 2/4/21 10:52 AM, Michael Davidsaver wrote:
> On 2/3/21 5:23 PM, Michael Davidsaver wrote:
> ...
>> How about improving the error message by printing the choices list from
>> dbPutString() in a way which invites copy+paste?
>>
>>> Can't set "foo.SCAN" to "10 seconds" Extraneous characters
>>> Error at or before ")" in path "." file "badchoice.db" line 2
>>> dbLoadRecords: failed to load 'badchoice.db'
>>> Error: Failed to load: badchoice.db
>> might become
> Ok, this is the best I have time for today. Not perfect, as you can see
> it gets my "Pensive" wrong. Maybe someone knows a better similarity algorithm?
>
> https://github.com/epics-base/epics-base/pull/104
After investigation a little more. aka. reading https://en.wikipedia.org/wiki/Edit_distance
I found https://en.wikipedia.org/wiki/Levenshtein_distance which seems to work much better.
Now I think the "Did you mean" suggestions should be reasonably useful, while only adding one
line of output.
Does this seem like a reasonable compromise in terms of SNR?
> Can't set "bar.DTYP" to "Soft Chanel" Not devsup for ai : No digits to convert
> Did you mean "Soft Channel"?
> Can't set "baz.IVOA" to "Set output To IVOV" using menuIvoa.dbd : No digits to convert
> Did you mean "Set output to IVOV"?
- Replies:
- Re: CaSe-IndepeDent Menu SEARches? Ralph Lange via Core-talk
- References:
- CaSe-IndepeDent Menu SEARches? Johnson, Andrew N. via Core-talk
- Re: CaSe-IndepeDent Menu SEARches? Michael Davidsaver via Core-talk
- Re: CaSe-IndepeDent Menu SEARches? Michael Davidsaver via Core-talk
- Navigate by Date:
- Prev:
Re: iocsh scripts and not using $PWD Michael Davidsaver via Core-talk
- Next:
Re: CaSe-IndepeDent Menu SEARches? Ralph Lange via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
<2021>
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: CaSe-IndepeDent Menu SEARches? Michael Davidsaver via Core-talk
- Next:
Re: CaSe-IndepeDent Menu SEARches? Ralph Lange via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
<2021>
2022
2023
2024
|