Deutsch English Français Italiano |
<v456ak$3pmpo$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: HenHanna <HenHanna@devnull.tb> Newsgroups: comp.lang.python,comp.lang.misc Subject: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3)) Date: Sun, 9 Jun 2024 14:20:20 -0700 Organization: A noiseless patient Spider Lines: 22 Message-ID: <v456ak$3pmpo$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 09 Jun 2024 23:20:20 +0200 (CEST) Injection-Info: dont-email.me; posting-host="ed01cd9e6d841d23fe19143a8bec1fed"; logging-data="3988280"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+031JokDcfFo3e+03SY6D5anWe9o6AndI=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:OIh6iIs8scLZDA5oVR17jGMnAtI= Content-Language: en-US Bytes: 1475 Chunk, ChunkC -- nice simple way(s) to write these in Python? (Chunk '(a a b a a a b b)) ==> ((a a) (b) (a a a) (b b)) (Chunk '(a a a a b c c a a d e e e e)) ==> ((a a a a) (b) (c c) (a a) (d) (e e e e)) (Chunk '(2 2 foo bar bar j j j k baz baz)) ==> ((2 2) (foo) (bar bar) (j j j) (k) (baz baz)) _________________ (ChunkC '(a a b b b)) ==> ((a 2) (b 3)) (ChunkC '(a a b a a a b b)) ==> ((a 2) (b 1) (a 3) (b 2))