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


Groups > comp.lang.python > #31531

Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <wxjmfauth@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.021
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'received:209.85.223': 0.03; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'def': 0.10; 'oct': 0.16; 'subject: \n ': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'all,': 0.21; 'import': 0.21; 'cc:2**0': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'replace': 0.27; '>>>>': 0.29; 'subject:size': 0.29; 'this.': 0.29; 'received:google.com': 0.34; 'wrong': 0.34; 'false': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'skip:u 20': 0.36; 'subject:with': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'from:no real name:2**0': 0.60; 'decided': 0.65; 'capital': 0.68; 'subject:NOT': 0.84; 'subject:any': 0.84
Newsgroups comp.lang.python
Date Wed, 17 Oct 2012 11:17:16 -0700 (PDT)
In-Reply-To <mailman.2354.1350493663.27098.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=81.62.101.121; posting-account=ung4FAoAAAC46zhHJ0Nsnuox7M5gDvs_
References <a7454cb7-e6dc-4167-b72a-56a67a5873a7@googlegroups.com> <mailman.2350.1350486045.27098.python-list@python.org> <748e561a-7e75-4b13-be6b-91831d3b59c4@googlegroups.com> <mailman.2354.1350493663.27098.python-list@python.org>
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-IP 81.62.101.121
MIME-Version 1.0
Subject Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
From wxjmfauth@gmail.com
To comp.lang.python@googlegroups.com
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Cc Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Message-ID <mailman.2358.1350497840.27098.python-list@python.org> (permalink)
Lines 47
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1350497840 news.xs4all.nl 6921 [2001:888:2000:d::a6]:60055
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31531

Show key headers only | View raw


Le mercredi 17 octobre 2012 19:07:43 UTC+2, Ian a écrit :
> On Wed, Oct 17, 2012 at 9:32 AM,  <wxjmfauth@gmail.com> wrote:
> 
> >>>> import unicodedata
> 
> >>>> def HasDiacritics(w):
> 
> > ...     w_decomposed = unicodedata.normalize('NFKD', w)
> 
> > ...     return 'no' if len(w) == len(w_decomposed) else 'yes'
> 
> > ...
> 
> >>>> HasDiacritics('éléphant')
> 
> > 'yes'
> 
> >>>> HasDiacritics('elephant')
> 
> > 'no'
> 
> >>>> HasDiacritics('\N{LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON}')
> 
> > 'yes'
> 
> >>>> HasDiacritics('U')
> 
> > 'no'
> 
> 
> 
> Is there something wrong with True and False that you had to replace
> 
> them with strings?
> 
> 
> 
> "return len(w) != len(w_decomposed)" is all you need.

Not at all, I knew this. In this I decided to program like
this.

Do you get it?  Yes/No  or True/False

jmf

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


Thread

Script for finding words of any size that do NOT contain vowels with acute diacritic marks? nwaits <nowaits@gmail.com> - 2012-10-17 07:31 -0700
  Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? Dave Angel <d@davea.name> - 2012-10-17 11:00 -0400
    Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? wxjmfauth@gmail.com - 2012-10-17 08:32 -0700
      Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-17 11:07 -0600
        Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? wxjmfauth@gmail.com - 2012-10-17 11:17 -0700
          Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? Chris Angelico <rosuav@gmail.com> - 2012-10-18 05:22 +1100
          Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-17 12:27 -0600
            Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? wxjmfauth@gmail.com - 2012-10-17 11:33 -0700
            Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? wxjmfauth@gmail.com - 2012-10-17 11:33 -0700
        Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? wxjmfauth@gmail.com - 2012-10-17 11:17 -0700
      Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? David Robinow <drobinow@gmail.com> - 2012-10-17 13:16 -0400
        Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-17 23:18 +0000
    Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? wxjmfauth@gmail.com - 2012-10-17 08:32 -0700

csiph-web