stevena has asked for the wisdom of the Perl Monks concerning the following question:
Given a lexicon with long words and short words (happening to be length 9 and up, and 8 and down, respectively), I am looking to enumerate all minimal extensions of a short by a long; that is, with no intervening word (either long or short) that extends the short and is extended by the long. (Extensions could also be called strict superstrings.)
I.e., if 'w > x' means word w extends word x, I want to find all pairs (L, S), such that:
* L > S
* there's no W with L > W > S,
where L, S, W are restricted to lexicon words.
For example, (NUMERICAL, NUMERIC) is desired, but not (SOCIOBIOLOGIST, OLOGIST) because SOCIOBIOLOGIST > BIOLOGIST > OLOGIST.
I am looking for transparent code conducive to my adding less interesting constraints. (Fine if you guide me without writing the code. Also happy to see code.)
Not homework or work -- solely hobby-related. Thanks!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: minimal superstrings/maximal substrings
by jcb (Parson) on Aug 20, 2019 at 01:25 UTC | |
by Laurent_R (Canon) on Aug 20, 2019 at 08:42 UTC | |
Re: minimal superstrings/maximal substrings
by AnomalousMonk (Archbishop) on Aug 20, 2019 at 01:01 UTC | |
Re: minimal superstrings/maximal substrings
by tybalt89 (Monsignor) on Aug 20, 2019 at 10:21 UTC | |
by tybalt89 (Monsignor) on Aug 20, 2019 at 10:45 UTC | |
Re: minimal superstrings/maximal substrings
by LanX (Saint) on Aug 22, 2019 at 12:57 UTC | |
Re: minimal superstrings/maximal substrings
by The Perlman (Scribe) on Aug 21, 2019 at 14:20 UTC | |
Re: minimal superstrings/maximal substrings
by stevena (Novice) on Aug 20, 2019 at 00:29 UTC | |
by Marshall (Canon) on Aug 20, 2019 at 01:06 UTC |