| Original Message (ID '39328') By Mark: |
| In Response To 'Re: Re: Re: Re: DictionaryLookup for a pair of ...'
---------
Thank you, Bill
The code is now:
bword=Map[{Rest[Characters[#]],#}&,DictionaryLookup[RegularExpression["^b......$"]]];
mword=Map[{Rest[Characters[#]],#}&,DictionaryLookup[RegularExpression["^m......$"]]];
matches=Intersection[Map[First,bword],Map[First,mword]];
Map[{Cases[bword,{#,_}],Cases[mword,{#,_}]}&,matches]
The results are correct except that BUCK UP and MUCK UP is returned because space counts as a character. It would be better to remove all punctuation before searching (and get BUCKS UP and MUCKS UP) but that is probably rather difficult unless we do so in the dictionary itself. I have used a better dictionary than the inbuilt one and I get 128 cases (the inbuilt one only gave 74 cases).
|
|