[Pyparsing] Supporting Spelling Variations
Brought to you by:
ptmcg
From: Tim C. <tim...@gm...> - 2007-09-10 08:36:45
|
Hi All, I need to support both 'specialise' and 'specialize' (actually there are many British/Australian/US spelling variations like this) My first attempts were to use either an Or list or a MatchFirst list. i.e. Suppress("specialise" Or "specialize") Each of those raised: TypeError: unsupported operand type(s) for ^: 'str' and 'str' My solution (so far) is: specialise = Suppress("specialise") specialize = Suppress("specialize") specialiseSection = (specialise | specialize + ... Is there a better/more efficient approach? Cheers, Tim -- Timothy Cook, MSc Health Informatics Research & Development Services http://timothywayne.cook.googlepages.com/home 01-904-322-8582 |