Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8214

Re: Python Regular Expressions

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Neil Cerutti <neilc@norwich.edu>
Newsgroups comp.lang.python
Subject Re: Python Regular Expressions
Date 22 Jun 2011 14:58:51 GMT
Organization Norwich University
Lines 23
Message-ID <96ee9bFlrrU1@mid.individual.net> (permalink)
References <3b65fd1f-d377-49b8-b00a-f80462a1213d@35g2000prp.googlegroups.com> <77c4973c-7315-4b4d-8eae-3f5770dfb530@22g2000prx.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Trace individual.net TVksBEv1kuEPILwgkO9x8wfN38gkHEPvUoak7/TMOqzsYD2ijo
Cancel-Lock sha1:xgOu2nl3MhFZpQmIjnB8fgVFqSo=
User-Agent slrn/0.9.9p1/mm/ao (Win32)
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:8214

Show key headers only | View raw


On 2011-06-22, Andy Barnes <andy.barnes@gmail.com> wrote:
> to expand. I have parsed one of the lines manually to try and break
> the process I'm trying to automate down.
>
> source:
> Theurgic Lore, Lore, n/a, 105, 70, 30, Distil Mana
>
> output:
> TheurgicLore [label="{ Theurgic Lore |{Lore|n/a}|{105|70|30}}"];
> DistilMana -> TheurgicLore;
>
> This is the steps I would take to do this conversion manually:

It seems to me that parsing the file into an intermediate model
and then using that model to serialize your output would be
easier to understand and more robust than modifying the csv
entries in place. It decouples deciphering the meaning of the
data from emitting the data, which is more robust and expansable.

The amount of ingenuity required is less, though. ;)

-- 
Neil Cerutti

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python Regular Expressions Andy  Barnes <andy.barnes@gmail.com> - 2011-06-22 07:00 -0700
  Re: Python Regular Expressions Andy Barnes <andy.barnes@gmail.com> - 2011-06-22 07:26 -0700
    Re: Python Regular Expressions Neil Cerutti <neilc@norwich.edu> - 2011-06-22 14:58 +0000
  Re: Python Regular Expressions Peter Otten <__peter__@web.de> - 2011-06-22 17:05 +0200
  Re: Python Regular Expressions Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-06-22 21:50 -0700

csiph-web