<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, jumble word permute</title>
    <link>http://www.mapleprimes.com/questions/130298-Jumble-Word-Permute</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Sat, 13 Jun 2026 09:56:17 GMT</lastBuildDate>
    <pubDate>Sat, 13 Jun 2026 09:56:17 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, jumble word permute</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, jumble word permute</title>
      <link>http://www.mapleprimes.com/questions/130298-Jumble-Word-Permute</link>
    </image>
    <item>
      <title>jumble</title>
      <link>http://www.mapleprimes.com/questions/130298-Jumble-Word-Permute?ref=Feed:MaplePrimes:jumble word permute:Comments#answer130299</link>
      <itunes:summary>&lt;p&gt;How's this?&lt;/p&gt;
&lt;p&gt;It's no better than the quality of the dictionary being used. And there are some words missing from the builtin dictionary. One can, however, read in one's own set of words and assign it to the variable `words`, which the routine `findall` below accesses as a global variable.&lt;/p&gt;
&lt;pre&gt;restart:

with(StringTools):
with(PatternDictionary):

bid:= Create(`builtin`):
words:= [seq](Get(bid,i),i=1..Size(bid)-1):

unwith(PatternDictionary):
unwith(StringTools):

findall:=proc(input::string,char::string,lo::posint,hi::posint)
global words;
local i, all, pos, final;
uses StringTools;
   if length(char)&amp;lt;&amp;gt;1 then
      error "expecting single character for 2nd argument";
   end if;
   if hi&amp;gt;length(input) then
      error "expecting 4th argument to be posint at most the length of 1st argument";
   end if;
   all:=Explode(input);
   pos:=Search("r",input);
   if pos&amp;gt;0 then
      all := [all[1..pos-1][],all[pos+1..-1][]];
   end if;
   for i from lo to hi do
      final[i]:=seq(Anagrams(Implode([x[],char]),words),
                    x in {combinat:-choose(all,i-1)[]});
   end do;
   eval(final);
end proc:

findall("speak", "k", 2, 4);

              table([2 = (), 3 = "ask", 4 = ("peak", "sake")])

findall("collapsing", "p", 4, 9);

              table([4 = ("pica", "clap", "capo", "pang", "gasp", "pail", "pain", "pall",
                          "plan", "opal", "slap", "span", "snap", "soap", "clip", "ping",
                          "pong", "pill", "lisp", "slip", "pion", "snip", "spin", "ipso",
                          "poll", "plop", "slop"),
                     5 = ("panic", "clasp", "scalp", "plain", "piano", "spill", "spoil",
                          "polis"),
                     6 = ("gallop", "spinal", "poplin"),
                     7 = ("scallop", "sapling"),
                     8 = (),
                     9 = ()])

convert(%,list);

              ["pica", "clap", "capo", "pang", "gasp", "pail", "pain", "pall",

                "plan", "opal", "slap", "span", "snap", "soap", "clip", "ping",

                "pong", "pill", "lisp", "slip", "pion", "snip", "spin", "ipso",

                "poll", "plop", "slop", "panic", "clasp", "scalp", "plain",

                "piano", "spill", "spoil", "polis", "gallop", "spinal",

                "poplin", "scallop", "sapling"]

findall("iocmrelae", "r", 4, 9):

convert(%,list);

              ["race", "care", "acre", "cram", "real", "earl", "ream", "mare",

                "lair", "rail", "liar", "oral", "roam", "rice", "core", "leer",

                "reel", "mere", "mire", "rime", "lore", "role", "more", "roil",

                "clear", "cream", "carol", "coral", "macro", "realm", "moral",

                "molar", "relic", "crime", "micro", "moire", "morel", "cereal",

                "oracle", "morale", "miracle", "calorie"]
&lt;/pre&gt;
&lt;!--break--&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;How's this?&lt;/p&gt;
&lt;p&gt;It's no better than the quality of the dictionary being used. And there are some words missing from the builtin dictionary. One can, however, read in one's own set of words and assign it to the variable `words`, which the routine `findall` below accesses as a global variable.&lt;/p&gt;
&lt;pre&gt;restart:

with(StringTools):
with(PatternDictionary):

bid:= Create(`builtin`):
words:= [seq](Get(bid,i),i=1..Size(bid)-1):

unwith(PatternDictionary):
unwith(StringTools):

findall:=proc(input::string,char::string,lo::posint,hi::posint)
global words;
local i, all, pos, final;
uses StringTools;
   if length(char)&amp;lt;&amp;gt;1 then
      error "expecting single character for 2nd argument";
   end if;
   if hi&amp;gt;length(input) then
      error "expecting 4th argument to be posint at most the length of 1st argument";
   end if;
   all:=Explode(input);
   pos:=Search("r",input);
   if pos&amp;gt;0 then
      all := [all[1..pos-1][],all[pos+1..-1][]];
   end if;
   for i from lo to hi do
      final[i]:=seq(Anagrams(Implode([x[],char]),words),
                    x in {combinat:-choose(all,i-1)[]});
   end do;
   eval(final);
end proc:

findall("speak", "k", 2, 4);

              table([2 = (), 3 = "ask", 4 = ("peak", "sake")])

findall("collapsing", "p", 4, 9);

              table([4 = ("pica", "clap", "capo", "pang", "gasp", "pail", "pain", "pall",
                          "plan", "opal", "slap", "span", "snap", "soap", "clip", "ping",
                          "pong", "pill", "lisp", "slip", "pion", "snip", "spin", "ipso",
                          "poll", "plop", "slop"),
                     5 = ("panic", "clasp", "scalp", "plain", "piano", "spill", "spoil",
                          "polis"),
                     6 = ("gallop", "spinal", "poplin"),
                     7 = ("scallop", "sapling"),
                     8 = (),
                     9 = ()])

convert(%,list);

              ["pica", "clap", "capo", "pang", "gasp", "pail", "pain", "pall",

                "plan", "opal", "slap", "span", "snap", "soap", "clip", "ping",

                "pong", "pill", "lisp", "slip", "pion", "snip", "spin", "ipso",

                "poll", "plop", "slop", "panic", "clasp", "scalp", "plain",

                "piano", "spill", "spoil", "polis", "gallop", "spinal",

                "poplin", "scallop", "sapling"]

findall("iocmrelae", "r", 4, 9):

convert(%,list);

              ["race", "care", "acre", "cram", "real", "earl", "ream", "mare",

                "lair", "rail", "liar", "oral", "roam", "rice", "core", "leer",

                "reel", "mere", "mire", "rime", "lore", "role", "more", "roil",

                "clear", "cream", "carol", "coral", "macro", "realm", "moral",

                "molar", "relic", "crime", "micro", "moire", "morel", "cereal",

                "oracle", "morale", "miracle", "calorie"]
&lt;/pre&gt;
&lt;!--break--&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>130299</guid>
      <pubDate>Fri, 03 Feb 2012 11:54:52 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>mistake somewhere</title>
      <link>http://www.mapleprimes.com/questions/130298-Jumble-Word-Permute?ref=Feed:MaplePrimes:jumble word permute:Comments#comment130332</link>
      <itunes:summary>&lt;p&gt;There is a mistake somewhere &lt;br&gt;&lt;br&gt;findall("speak",s",5,5)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table([5 = ("speak", "passe")])&lt;/p&gt;
&lt;p&gt;passe shouldn't be there, speak doesn't contain 2 s's&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: mceinline;"&gt;A great word database is sowpods.zip&amp;nbsp;a scrabble dictionary of 267,751 words as compared to the builtin of 25,950 which hasn't changed since at least Maple 9.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;There is a mistake somewhere &lt;br&gt;&lt;br&gt;findall("speak",s",5,5)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table([5 = ("speak", "passe")])&lt;/p&gt;
&lt;p&gt;passe shouldn't be there, speak doesn't contain 2 s's&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: mceinline;"&gt;A great word database is sowpods.zip&amp;nbsp;a scrabble dictionary of 267,751 words as compared to the builtin of 25,950 which hasn't changed since at least Maple 9.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>130332</guid>
      <pubDate>Sun, 05 Feb 2012 02:51:46 Z</pubDate>
      <itunes:author>Christopher2222</itunes:author>
      <author>Christopher2222</author>
    </item>
    <item>
      <title>sorry</title>
      <link>http://www.mapleprimes.com/questions/130298-Jumble-Word-Permute?ref=Feed:MaplePrimes:jumble word permute:Comments#comment130335</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/130298-Jumble-Word-Permute#comment130332"&gt;@Christopher2222&lt;/a&gt;&amp;nbsp;Sorry, when turning the code into a procedure I inadvertantly left the Search to be hard-coded for the letter "r". The Search line ought to be,&lt;/p&gt;
&lt;pre&gt;    pos:=Search(char,input);
&lt;/pre&gt;
&lt;p&gt;So the procedure would be,&lt;/p&gt;
&lt;pre&gt;restart:

with(StringTools):
with(PatternDictionary):

bid:= Create(`builtin`):
words:= [seq](Get(bid,i),i=1..Size(bid)-1):

unwith(PatternDictionary):
unwith(StringTools):

findall:=proc(input::string,char::string,lo::posint,hi::posint)
global words;
local i, all, pos, final;
uses StringTools;
   if length(char)&amp;lt;&amp;gt;1 then
      error "expecting single character for 2nd argument";
   end if;
   if hi&amp;gt;length(input) then
      error "expecting 4th argument to be posint at most the length of 1st argument";
   end if;
   all:=Explode(input);
   pos:=Search(char,input);
   if pos&amp;gt;0 then
      all := [all[1..pos-1][],all[pos+1..-1][]];
   end if;
   for i from lo to hi do
      final[i]:=seq(Anagrams(Implode([x[],char]),words),
                    x in {combinat:-choose(all,i-1)[]});
   end do;
   eval(final);
end proc:

findall("speak","s",5,5);

                                table([5 = "speak"])

findall("speak","s",3,5);

         table([3 = ("sea", "ask", "spa", "sap"), 4 = ("sake", "apse"), 5 = "speak"])
&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/130298-Jumble-Word-Permute#comment130332"&gt;@Christopher2222&lt;/a&gt;&amp;nbsp;Sorry, when turning the code into a procedure I inadvertantly left the Search to be hard-coded for the letter "r". The Search line ought to be,&lt;/p&gt;
&lt;pre&gt;    pos:=Search(char,input);
&lt;/pre&gt;
&lt;p&gt;So the procedure would be,&lt;/p&gt;
&lt;pre&gt;restart:

with(StringTools):
with(PatternDictionary):

bid:= Create(`builtin`):
words:= [seq](Get(bid,i),i=1..Size(bid)-1):

unwith(PatternDictionary):
unwith(StringTools):

findall:=proc(input::string,char::string,lo::posint,hi::posint)
global words;
local i, all, pos, final;
uses StringTools;
   if length(char)&amp;lt;&amp;gt;1 then
      error "expecting single character for 2nd argument";
   end if;
   if hi&amp;gt;length(input) then
      error "expecting 4th argument to be posint at most the length of 1st argument";
   end if;
   all:=Explode(input);
   pos:=Search(char,input);
   if pos&amp;gt;0 then
      all := [all[1..pos-1][],all[pos+1..-1][]];
   end if;
   for i from lo to hi do
      final[i]:=seq(Anagrams(Implode([x[],char]),words),
                    x in {combinat:-choose(all,i-1)[]});
   end do;
   eval(final);
end proc:

findall("speak","s",5,5);

                                table([5 = "speak"])

findall("speak","s",3,5);

         table([3 = ("sea", "ask", "spa", "sap"), 4 = ("sake", "apse"), 5 = "speak"])
&lt;/pre&gt;</description>
      <guid>130335</guid>
      <pubDate>Sun, 05 Feb 2012 05:49:08 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>large database</title>
      <link>http://www.mapleprimes.com/questions/130298-Jumble-Word-Permute?ref=Feed:MaplePrimes:jumble word permute:Comments#comment130336</link>
      <itunes:summary>&lt;p&gt;Thanks acer, works nicely now.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now I mentioned a nice free word database sowpods.txt (found on sourceforge) which is only 2 Mb when unzipped but reading it into Maple causes Maple to use about 27Mb's.&amp;nbsp; That's using the command readdata("g:/sowpods.txt",string,1).&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&lt;br&gt;Are there other ways to read in large databases&amp;nbsp;while consuming less memory or I should say more efficiently?&lt;/p&gt;
&lt;p&gt;Or I suppose what I mean is, and this is probably really a second question,&amp;nbsp;is there a way (and how) using Maple to&amp;nbsp;search the database without actually loading it into Maple to conserve memory?&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Thanks acer, works nicely now.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now I mentioned a nice free word database sowpods.txt (found on sourceforge) which is only 2 Mb when unzipped but reading it into Maple causes Maple to use about 27Mb's.&amp;nbsp; That's using the command readdata("g:/sowpods.txt",string,1).&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&lt;br&gt;Are there other ways to read in large databases&amp;nbsp;while consuming less memory or I should say more efficiently?&lt;/p&gt;
&lt;p&gt;Or I suppose what I mean is, and this is probably really a second question,&amp;nbsp;is there a way (and how) using Maple to&amp;nbsp;search the database without actually loading it into Maple to conserve memory?&lt;/p&gt;</description>
      <guid>130336</guid>
      <pubDate>Sun, 05 Feb 2012 06:30:39 Z</pubDate>
      <itunes:author>Christopher2222</itunes:author>
      <author>Christopher2222</author>
    </item>
    <item>
      <title>fine tuning</title>
      <link>http://www.mapleprimes.com/questions/130298-Jumble-Word-Permute?ref=Feed:MaplePrimes:jumble word permute:Comments#comment130358</link>
      <itunes:summary>&lt;p&gt;&amp;gt; findall("speak", "t", 4, 5);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;TABLE([5 = ("stake", "steak", "skate", "paste", "spate", "septa"), 4 = (&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; "take", "tape", "peat", "pate", "seat", "east", "skat", "task", "spat",&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; "past", "kept", "pest", "sept", "step")])&lt;/p&gt;
&lt;p&gt;trivially and explicitly we could add&lt;/p&gt;
&lt;p&gt;&amp;nbsp; if Search(char,input)=0 then&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; error "expecting 2nd argument to be part of 1st argument"&lt;br&gt;&amp;nbsp; end if;&lt;/p&gt;
&lt;p&gt;&amp;gt;findall("speak", "t", 4, 5);&lt;br&gt;Error, (in findall) expecting 2nd argument to be part of 1st argument&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&amp;gt; findall("speak", "t", 4, 5);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;TABLE([5 = ("stake", "steak", "skate", "paste", "spate", "septa"), 4 = (&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; "take", "tape", "peat", "pate", "seat", "east", "skat", "task", "spat",&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; "past", "kept", "pest", "sept", "step")])&lt;/p&gt;
&lt;p&gt;trivially and explicitly we could add&lt;/p&gt;
&lt;p&gt;&amp;nbsp; if Search(char,input)=0 then&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; error "expecting 2nd argument to be part of 1st argument"&lt;br&gt;&amp;nbsp; end if;&lt;/p&gt;
&lt;p&gt;&amp;gt;findall("speak", "t", 4, 5);&lt;br&gt;Error, (in findall) expecting 2nd argument to be part of 1st argument&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>130358</guid>
      <pubDate>Mon, 06 Feb 2012 04:48:23 Z</pubDate>
      <itunes:author>Christopher2222</itunes:author>
      <author>Christopher2222</author>
    </item>
    <item>
      <title>considered it (re: fine tuning)</title>
      <link>http://www.mapleprimes.com/questions/130298-Jumble-Word-Permute?ref=Feed:MaplePrimes:jumble word permute:Comments#comment130359</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/130298-Jumble-Word-Permute#comment130358"&gt;@Christopher2222&lt;/a&gt;&amp;nbsp;I considered that case but figured that the original post was slightly ambiguous on the issue and (much more importantly) that if I has misinterpreted then it didn't matter since a pre-check would be so trivial that anyone could write it.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/130298-Jumble-Word-Permute#comment130358"&gt;@Christopher2222&lt;/a&gt;&amp;nbsp;I considered that case but figured that the original post was slightly ambiguous on the issue and (much more importantly) that if I has misinterpreted then it didn't matter since a pre-check would be so trivial that anyone could write it.&lt;/p&gt;</description>
      <guid>130359</guid>
      <pubDate>Mon, 06 Feb 2012 06:03:08 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
  </channel>
</rss>