| Original Message (ID '39103') By Mark: |
| In Response To 'Re: Re: Re: Re: DictionaryLookup for a pair of ...'
---------
Thank you again, Bill.
Now it nearly works:
bindex = Map[{Sort[Rest[Characters[#]]], #} &, DictionaryLookup[RegularExpression["b......"]]];
mindex = Map[{Sort[Rest[Characters[#]]], #} &, DictionaryLookup[RegularExpression["m......"]]];
matches = Intersection[Map[First, bindex], Map[First, mindex]];
Map[{Cases[bindex, {#, _}], Cases[mindex, {#, _}]} &, matches]
This returns more than I wanted since it includes, for example {barbels marbles} where the words have the correct first letters but their other six letters are anagrams of one another.
However remove Sort and it does work:
bindex=Map[{Rest[Characters[#]],#}&,DictionaryLookup[RegularExpression["b......"]]];
mindex=Map[{Rest[Characters[#]],#}&,DictionaryLookup[RegularExpression["m......"]]];
matches=Intersection[Map[First,bindex],Map[First,mindex]];
Map[{Cases[bindex,{#,_}],Cases[mindex,{#,_}]}&,matches]
Thank you
|
|