Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'DictionaryLookup for a pair of words' topicStudent Support Forum > General > "DictionaryLookup for a pair of words"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Mark
09/27/12 01:04am

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


URL: ,

Subject (listing for 'DictionaryLookup for a pair of words')
Author Date Posted
DictionaryLookup for a pair of words Mark 09/26/12 07:53am
Re: DictionaryLookup for a pair of words Forum Modera... 09/26/12 11:47am
Re: Re: DictionaryLookup for a pair of words Bill Simpson 09/26/12 3:03pm
Re: Re: Re: DictionaryLookup for a pair of words Mark 09/26/12 4:35pm
Re: Re: Re: Re: DictionaryLookup for a pair of ... Bill Simpson 09/26/12 7:57pm
Re: Re: Re: Re: Re: DictionaryLookup for a pair... Mark 09/27/12 01:04am
Re: Re: Re: Re: DictionaryLookup for a pair of ... Bill Simpson 09/26/12 8:41pm
Re: Re: Re: Re: Re: DictionaryLookup for a pair... Mark 09/27/12 12:00pm
Re: DictionaryLookup for a pair of words Mark 09/26/12 2:09pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic