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

2012-10-17 Thread nwaits
I'm very impressed with python's wordlist script for plain text. Is there a script for finding words that do NOT have certain diacritic marks, like acute or grave accents (utf-8), over the vowels? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

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

2012-10-17 Thread Dave Angel
On 10/17/2012 10:31 AM, nwaits wrote: I'm very impressed with python's wordlist script for plain text. Is there a script for finding words that do NOT have certain diacritic marks, like acute or grave accents (utf-8), over the vowels? Thank you. if you can construct a list of illegal

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

2012-10-17 Thread wxjmfauth
Le mercredi 17 octobre 2012 17:00:46 UTC+2, Dave Angel a écrit : On 10/17/2012 10:31 AM, nwaits wrote: I'm very impressed with python's wordlist script for plain text. Is there a script for finding words that do NOT have certain diacritic marks, like acute or grave accents (utf-8),

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

2012-10-17 Thread Ian Kelly
On Wed, Oct 17, 2012 at 9:32 AM, wxjmfa...@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'

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

2012-10-17 Thread David Robinow
On Wed, Oct 17, 2012 at 1:07 PM, Ian Kelly ian.g.ke...@gmail.com wrote: return len(w) != len(w_decomposed) is all you need. Thanks for helping, but I already knew that. -- http://mail.python.org/mailman/listinfo/python-list

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

2012-10-17 Thread wxjmfauth
Le mercredi 17 octobre 2012 19:07:43 UTC+2, Ian a écrit : On Wed, Oct 17, 2012 at 9:32 AM, wxjmfa...@gmail.com wrote: import unicodedata def HasDiacritics(w): ... w_decomposed = unicodedata.normalize('NFKD', w) ... return 'no' if len(w) == len(w_decomposed) else 'yes'

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

2012-10-17 Thread Chris Angelico
On Thu, Oct 18, 2012 at 5:17 AM, wxjmfa...@gmail.com wrote: Not at all, I knew this. In this I decided to program like this. Do you get it? Yes/No or True/False Yes but why? When you're returning a boolean concept, why not return a boolean value? You don't even use values with one that

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

2012-10-17 Thread Ian Kelly
On Wed, Oct 17, 2012 at 12:17 PM, wxjmfa...@gmail.com wrote: Not at all, I knew this. In this I decided to program like this. Do you get it? Yes/No or True/False It's just bad style, because both 'yes' and 'no' evaluate true. if HasDiacritics('éléphant'): print('Correct!') if

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

2012-10-17 Thread wxjmfauth
Le mercredi 17 octobre 2012 20:28:21 UTC+2, Ian a écrit : On Wed, Oct 17, 2012 at 12:17 PM, wxjmfa...@gmail.com wrote: Not at all, I knew this. In this I decided to program like this. Do you get it? Yes/No or True/False It's just bad style, because both 'yes' and 'no'

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

2012-10-17 Thread Steven D'Aprano
On Wed, 17 Oct 2012 13:16:43 -0400, David Robinow wrote: On Wed, Oct 17, 2012 at 1:07 PM, Ian Kelly ian.g.ke...@gmail.com wrote: return len(w) != len(w_decomposed) is all you need. Thanks for helping, but I already knew that. David, Ian was directly responding to wxjmfa...@gmail.com, whose