Thread overview | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
November 12, 2005 isalpha for beyond ASCII? | ||||
---|---|---|---|---|
| ||||
Looking at the isalpha function in std.ctype, it seems it's only available for ASCII code support which is fine for most purposes. However, I'd like to find something a bit more complete than that, checking alpha characters (dchars) for languages in say, Greek, Russian, Japanese, etc. Does this make any sense? Is there anything existing out there for D that can handle this job? |
November 12, 2005 Re: isalpha for beyond ASCII? | ||||
---|---|---|---|---|
| ||||
Posted in reply to James Dunne | James Dunne wrote:
> Looking at the isalpha function in std.ctype, it seems it's only available for ASCII code support which is fine for most purposes.
>
> However, I'd like to find something a bit more complete than that, checking alpha characters (dchars) for languages in say, Greek, Russian, Japanese, etc. Does this make any sense? Is there anything existing out there for D that can handle this job?
*browses through dmd/src/dmd ...*
*peeks at dmd/src/dmd/unialpha.c*
=-O
I'll be converting this to D right meow. Any caveats I should be aware of?
|
November 12, 2005 Re: isalpha for beyond ASCII? | ||||
---|---|---|---|---|
| ||||
Posted in reply to James Dunne | > I'll be converting this to D right meow. Any caveats I should be aware of? Hehe , is that a super trooper reference :) ? "James Dunne" <james.jdunne@gmail.com> wrote in message news:dl5cep$9m4$1@digitaldaemon.com... > James Dunne wrote: > > Looking at the isalpha function in std.ctype, it seems it's only available for ASCII code support which is fine for most purposes. > > > > However, I'd like to find something a bit more complete than that, checking alpha characters (dchars) for languages in say, Greek, Russian, Japanese, etc. Does this make any sense? Is there anything existing out there for D that can handle this job? > > *browses through dmd/src/dmd ...* > > *peeks at dmd/src/dmd/unialpha.c* > > =-O > > I'll be converting this to D right meow. Any caveats I should be aware of? |
November 12, 2005 Re: isalpha for beyond ASCII? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles | Charles wrote: >>I'll be converting this to D right meow. Any caveats I should be aware > > of? > > Hehe , is that a super trooper reference :) ? > Am I sayin meow? > "James Dunne" <james.jdunne@gmail.com> wrote in message > news:dl5cep$9m4$1@digitaldaemon.com... > >>James Dunne wrote: >> >>>Looking at the isalpha function in std.ctype, it seems it's only >>>available for ASCII code support which is fine for most purposes. >>> >>>However, I'd like to find something a bit more complete than that, >>>checking alpha characters (dchars) for languages in say, Greek, Russian, >>>Japanese, etc. Does this make any sense? Is there anything existing >>>out there for D that can handle this job? >> >>*browses through dmd/src/dmd ...* >> >>*peeks at dmd/src/dmd/unialpha.c* >> >>=-O >> >>I'll be converting this to D right meow. Any caveats I should be aware > > of? > |
November 12, 2005 Re: isalpha for beyond ASCII? | ||||
---|---|---|---|---|
| ||||
Posted in reply to James Dunne | In article <dl5b96$8m7$1@digitaldaemon.com>, James Dunne says... > >Looking at the isalpha function in std.ctype, it seems it's only available for ASCII code support which is fine for most purposes. > >However, I'd like to find something a bit more complete than that, checking alpha characters (dchars) for languages in say, Greek, Russian, Japanese, etc. Does this make any sense? Is there anything existing out there for D that can handle this job? Hauke Duden's unichar.d that he released in June 2004 has a "bool charIsAlpha(dchar chr)" function that may fit the bill. Here's the release post and a link to the unichar.zip: http://www.digitalmars.com/d/archives/digitalmars/D/3868.html http://www.hazardarea.com/unichar.zip David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html |
November 13, 2005 Re: isalpha for beyond ASCII? | ||||
---|---|---|---|---|
| ||||
Posted in reply to David L. Davis | David L. Davis wrote:
> In article <dl5b96$8m7$1@digitaldaemon.com>, James Dunne says...
>
>>Looking at the isalpha function in std.ctype, it seems it's only available for ASCII code support which is fine for most purposes.
>>
>>However, I'd like to find something a bit more complete than that, checking alpha characters (dchars) for languages in say, Greek, Russian, Japanese, etc. Does this make any sense? Is there anything existing out there for D that can handle this job?
>
>
> Hauke Duden's unichar.d that he released in June 2004 has a "bool
> charIsAlpha(dchar chr)" function that may fit the bill.
>
> Here's the release post and a link to the unichar.zip:
> http://www.digitalmars.com/d/archives/digitalmars/D/3868.html
> http://www.hazardarea.com/unichar.zip
>
> David L.
>
> -------------------------------------------------------------------
> "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!"
> -------------------------------------------------------------------
>
> MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Apparently there is also a super-secret hidden feature of phobos... std.uni! There is a nearly identical function in there from the compiler's internal source code called isUniAlpha.
In my project, I'm using my own modified version of std.ctype which includes isUniAlpha and combines it with the isalpha, isalnum, etc. functions. Why not provide this functionality in std.ctype by default? std.ctype functions work with dchars anyway...
|
November 13, 2005 Re: isalpha for beyond ASCII? | ||||
---|---|---|---|---|
| ||||
Posted in reply to James Dunne | "James Dunne" <james.jdunne@gmail.com> wrote in message news:dl6442$tbj$2@digitaldaemon.com... > In my project, I'm using my own modified version of std.ctype which > includes isUniAlpha and combines it with the isalpha, isalnum, etc. > functions. Why not provide this functionality in std.ctype by default? > std.ctype functions work with dchars anyway... It's not in by default because isalpha() and company tend to be used in highly speed critical applications that often deal only with ASCII. Hence, it makes sense to split it into two functions. |
November 13, 2005 Re: isalpha for beyond ASCII? | ||||
---|---|---|---|---|
| ||||
Posted in reply to David L. Davis | David L. Davis wrote:
> In article <dl5b96$8m7$1@digitaldaemon.com>, James Dunne says...
>
>>Looking at the isalpha function in std.ctype, it seems it's only available for ASCII code support which is fine for most purposes.
>>
>>However, I'd like to find something a bit more complete than that, checking alpha characters (dchars) for languages in say, Greek, Russian, Japanese, etc. Does this make any sense? Is there anything existing out there for D that can handle this job?
>
>
> Hauke Duden's unichar.d that he released in June 2004 has a "bool
> charIsAlpha(dchar chr)" function that may fit the bill.
>
> Here's the release post and a link to the unichar.zip:
> http://www.digitalmars.com/d/archives/digitalmars/D/3868.html
> http://www.hazardarea.com/unichar.zip
>
> David L.
>
> -------------------------------------------------------------------
> "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!"
> -------------------------------------------------------------------
>
> MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Hm! Quite complete, if I do say so. But a bit too complete for my needs, and also comes with its own license with a request for credit. That's cool with me if I had chosen to go with it, but I don't think I need that much. std.uni.isUniAlpha is good enough (plus my own mods).
Thanks though!
|
Copyright © 1999-2021 by the D Language Foundation