Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-04

Text matching for configuration files etc.

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

I know that there are algorithms which given a text fragment will find the "best fit" from a number of candidates, based on how many substrings have to be deleted or changed.

Is there anything like this in the standard FPC library, and if not does anybody have one or a URL?

Application is a configuration file handler, where parameters describe things like keyboard layout, and I want to include some latitude so that a user doesn't have to get it exactly right if editing by hand.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]
Juha Manninen
to Mark Morgan Lloyd

On Wed, Apr 11, 2012 at 9:19 PM, Mark Morgan Lloyd <

Show quoted text 13 lines
wrote: I know that there are algorithms which given a text fragment will find the "best fit" from a number of candidates, based on how many substrings have to be deleted or changed. Is there anything like this in the standard FPC library, and if not does anybody have one or a URL? Application is a configuration file handler, where parameters describe things like keyboard layout, and I want to include some latitude so that a user doesn't have to get it exactly right if editing by hand.

Maybe you mean something like Soundex:
http://lazarus-ccr.sourceforge.net/docs/rtl/strutils/soundex.html

I myself would make a GUI for the configuration file and give all valid choices in comboboxes and radiogroups etc.

Juha

Noa Shiruba
to Juha Manninen

Hi,

I think this sounds more like "edit distance", but I am not sure why it would be needed for a config file.

Thank you,
Noah silva

Juha Manninen wrote 17 lines
On Wed, Apr 11, 2012 at 9:19 PM, Mark Morgan Lloyd wrote: I know that there are algorithms which given a text fragment will find the "best fit" from a number of candidates, based on how many substrings have to be deleted or changed. Is there anything like this in the standard FPC library, and if not does anybody have one or a URL? Application is a configuration file handler, where parameters describe things like keyboard layout, and I want to include some latitude so that a user doesn't have to get it exactly right if editing by hand. Maybe you mean something like Soundex: http://lazarus-ccr.sourceforge.net/docs/rtl/strutils/soundex.html I myself would make a GUI for the configuration file and give all valid choices in comboboxes and radiogroups etc. Juha _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Mark Morgan Lloyd
to Mark Morgan Lloyd: I know that there are algorithms which given a text fragment will find the "best fit"…
Mark Morgan Lloyd wrote 18 lines
I know that there are algorithms which given a text fragment will find the "best fit" from a number of candidates, based on how many substrings have to be deleted or changed. Is there anything like this in the standard FPC library, and if not does anybody have one or a URL? Application is a configuration file handler, where parameters describe things like keyboard layout, and I want to include some latitude so that a user doesn't have to get it exactly right if editing by hand. Maybe you mean something like Soundex: http://lazarus-ccr.sourceforge.net/docs/rtl/strutils/soundex.html I myself would make a GUI for the configuration file and give all valid choices in comboboxes and radiogroups etc. Juha

Soundex had occurred to me, but it's very much oriented towards (American) surnames: encode the start of the name followed by a digest of the remainder.

Show quoted text 5 lines
I think this sounds more like "edit distance", but I am not sure why it would be needed for a config file. Thank you, Noah silva

That was the term I was looking for, I see there's a Wp entry and I haven't even blown the dust off Knuth yet :-)

Basically, I've got descriptions of golfballs like

BCD, 88 character
Correspondence, 96 character
Correspondence, 88 character + APL

and (if I get enough interest from the target audience) I want to be able to provide users the option of applying tweaks that might exceed what's provided by the GUI.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]