Re: Re: [phpbugs@priorwebsites.com: Bug #16681 Updated: Request new words(), word(), wordindex(), wordlength() functions]

From: Date: Fri, 19 Apr 2002 11:40:35 +0000
Subject: Re: Re: [phpbugs@priorwebsites.com: Bug #16681 Updated: Request new words(), word(), wordindex(), wordlength() functions]
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1210@lists.php.net to get a copy of this message
Dealing with words is a specialization of dealing with strings, so I think "Text" would be a better name. What about Text::words(), Text::wordindex() etc? IMHO these functions should be multibyte (at least utf-8) and html-entity-aware, so the latin1 "å" utf-8-encoded or &aring; are both counted as one character. Counting characters in an utf-8 string is not so hard: when you are looking at the first byte "b" of the character "c", you can get how many bytes the character consists of with a single table lookup. I can help with with the multibyte stuff if necessary :-) - Stig On Fri, 2002-04-19 at 11:59, Tomas V.V.Cox wrote: > I'll vote for a String.php class if it will be done in PHP. If not just > pick-up a right name and put it under pear/PECL. > > Tomas V.V.Cox > > > Daniel Lorch wrote: > > > > Hi, > > > > Great idea. I could take care of this - how do I "assign" it to me? > > Just start writing code? > > > > -daniel > > > > ----- Original Message ----- > > From : derick@php.net [mailto:derick@php.net] > > Sent : Freitag, 19. April 2002 > > Subject: [PHP-DEV] [phpbugs@priorwebsites.com: Bug #16681 Updated: Request new words(), > > word(), wordindex(), wordlength() functions] > > > > > Hey, > > > > > why not make a PEAR thingy for this? > > > > > Derick > > > > > On Fri, 19 Apr 2002, Daniel Lorch wrote: > > > > >> hi, > > >> > > >> > Well, I like the idea(s). > > >> > > >> > I think returning (bool)false instead of NULL is more > > >> > consistent though. > > >> > > >> > Maybe the naming convention should be changed to: > > >> > > >> ..while paying attention to english orthography: > > >> > > >> > word() > > >> > word_count() > > >> > word_index() > > >> > word_lenght() > > >> > > >> word_length() > > >> > > >> common pitfall - maybe we should provide an alias? :) > > >> > > >> > - Markus > > >> > > >> word_* functions can be easily solved in userland, but nevertheless, > > >> after thinking about it, it might be a good addition. At least it does > > >> not hurt anyone, does it? :) > > >> > > >> -daniel > > >> > > >> > > >> > > >> -- > > >> PHP Development Mailing List > > >> <http://www.php.net/> > > >> To unsubscribe, visit: > > >> http://www.php.net/unsub.php > > >> > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.pear.general (#1210) next »