Re: help with DictionaryLookup[] and a type of regular expression
- To: mathgroup at smc.vnet.net
- Subject: [mg109652] Re: help with DictionaryLookup[] and a type of regular expression
- From: Albert Retey <awnl at gmx-topmail.de>
- Date: Mon, 10 May 2010 06:38:56 -0400 (EDT)
- References: <hs67kd$30l$1@smc.vnet.net>
Am 09.05.2010 13:51, schrieb Michael Stern:
> Is there an elegant way to do dictionary searches that match specified
> kinds of character repetition? For example, to search for six letter
> words that start with "d" and end with "k", where the third and fourth
> letter are the same?
>
> Finding six letter words that start with "d" and end with "k" is easy --
>
> DictionaryLookup[{"English", RegularExpression["d....k"]}]
>
> But how do we restrict the answer to words where the third and fourth
> letters are the same?
I guess you could do it with a regexp too, but in this case it was
easier for me to create a StringExpression:
DictionaryLookup[{"English", _ ~~ _ ~~ x_ ~~ x_ ~~ _ ~~ _}]
hth,
albert