MathGroup Archive 2009

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

Search the Archive

Re: String substitution system

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97214] Re: String substitution system
  • From: Raffy <raffy at mac.com>
  • Date: Sun, 8 Mar 2009 05:51:55 -0500 (EST)
  • References: <got89g$gge$1@smc.vnet.net>

vAlphabet = {"A", "B", "C", "D"};

vWords = Map[ StringJoin, Join @@ Table[Tuples[vAlphabet, i], {i,
7}] ];

vRules = {"CC" -> "C", "DD" -> "D", "CA" -> "C",
   "AC" -> "C", "DB" -> "D", "BD" -> "D", "CDC" -> "C", "DCD" -> "D",
   "CBC" -> "C", "DAD" -> "D", "ABC" -> "DC", "CBA" -> "CD",
   "BAD" -> "CD", "DAB" -> "DC", "BAB" -> "ABA"};

FixedPoint[StringReplace[#, vRules] &, vWords]


  • Prev by Date: Re: Bug in Pattern Matching with Condition?
  • Next by Date: Re: Re: typsetting bug still present in Mathematica 7.01
  • Previous by thread: Re: String substitution system
  • Next by thread: Version 7.0.1 bug with initial Palette positions