From carlos at bueno.org Tue Oct 30 15:57:12 2007 From: carlos at bueno.org (Carlos) Date: Tue, 30 Oct 2007 12:57:12 -0700 Subject: [Char-encodings-development] filtering alnum, punctuation, space, etc? Message-ID: <887494480710301257u2e92861al536cac2a5006bdf3@mail.gmail.com> Howdy -- Does this library help with distinguishing between alpha, numeric, punctuation, etc, in Unicode strings? I see some functions such as unichar_isalph() in the C code but I can't figure out how they translate into the Ruby interface. >> u('f').methods - 'f'.methods => ["foldcase!", "normalize", "foldcase"] >> x=u('h\303\251llo') => u"h?llo" >> x.gsub(/[^[:alpha:]]/, ' ') => "h llo" Cheers, Carlos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/char-encodings-development/attachments/20071030/3f541d18/attachment.html From now at bitwi.se Tue Oct 30 16:38:52 2007 From: now at bitwi.se (Nikolai Weibull) Date: Tue, 30 Oct 2007 21:38:52 +0100 Subject: [Char-encodings-development] filtering alnum, punctuation, space, etc? In-Reply-To: <887494480710301257u2e92861al536cac2a5006bdf3@mail.gmail.com> References: <887494480710301257u2e92861al536cac2a5006bdf3@mail.gmail.com> Message-ID: On 10/30/07, Carlos wrote: > Howdy -- Does this library help with distinguishing between alpha, numeric, > punctuation, etc, in Unicode strings? I see some functions such as > unichar_isalph() in the C code but I can't figure out how they translate > into the Ruby interface. No, this has not yet been added. I concentrated on creating the UTF-8 bindings first. Then I sadly started working full time and haven't had time to work on the library much. Please pay me to work on it and I'll quit my day job ;-). It's easy to add, by the way, but I wanted to factor out stuff common to all Unicode encodings and I hadn't quite nailed the API before I ran out of time, so to speak. We'll see what happens in Ruby 1.9. I've given the developers permission to use my code, but the problem is that it's based on stuff in GLib and GLib's developers have not responded to my requests of allowing a relicensing to the Ruby license. I'm not quite sure what the licensing issues are, or would be, as I have basically written all the code while looking at GLib for guidance. Oh, well...