MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

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


  • Prev by Date: Re: and a type of regular expression
  • Next by Date: Re: How to write reports and books in Mathematica
  • Previous by thread: help with DictionaryLookup[] and a type of regular expression
  • Next by thread: Re: help with DictionaryLookup[] and a type of regular expression