I have a similar conundrum. I'm writing a suite of preprocessors for Rozenshtein delta functions (aka Encoded Characteristic functions). The basic idea is really simple, and I imagine embedded quite deeply in the Perl psyche. The idea is that the delta function δ[x⊜y], where ⊜ is any comparison operator and the expression x⊜y returns boolean true or false, evaluates the comparison and returns 1 if true, or 0 if false.
The great thing (for me) is that there are rewrites from delta functions to plain ol' math for all the common comparisons -- rewrites that can be expressed in languages without a built-in "IF" or "CASE" statement. For example, δ[x=y] can be expanded to 1 - abs(sign(x - y)). The Perl expansion of any delta function δ[x⊜y] is simply !!(x⊜y), but not all languages are as forgiving. Anyway. Enough exposition. The problem I'm solving is to provide a suite of rewrite engines for various programming languages that detect embedded δ functions and rewrite them using the appropriate syntax for the containing language. Right now, I'm considering the Text::Rewrite::DeltaExpression::(.*) namespace where $1 is the target language. Any suggestions from y'all about better places to put it? Does Text::Filter::DeltaExpression::(.*) more closely fit what the community would be expecting? Thanks, -- Paul Bennett (aka PWBENNETT) On Wed, Dec 19, 2012 at 10:26 PM, Brian Katzung <bri...@kappacs.com> wrote: > Ben, > > How about creating Text::Filter::LowerCase and Text::Filter::Unpunctuate > as derived classes of Text::Filter? > > - Brian > > > On 2012-12-19 13:56, Ben Deutsch wrote: > >> Hello, >> >> I'm writing a small module to apply "lossy" filters to text, to enable >> better subsequent lossless compression. For example, "Hello, World!" would >> become "hello, world!" with the "lowercase" filter, or "Hello World" with >> the punctuation removal filter. This does not apply the actual compression, >> it just reduces the entropy of the text in question. >> >> As a working title, I'm using >> >> Text::Lossy >> >> as the module name. But "Text" is quite a large and well-known top-level >> namespace, so I'm asking if this is a good fit, and if not, what I might >> call the module instead. >> >> One thing I do *not* want to do is place it in the "Acme" namespace – the >> module may sound a bit silly, but it strives to do exactly what it says on >> the tin: every filter reduces the entropy while still retaining most of the >> meaning. For example, reducing the entire text to the empty string (while >> great for compression) is straight out. >> >> Thanks for your time, >> Ben Deutsch >> >> >> > -- > Brian Katzung, Kappa Computer Solutions, LLC > Offering web, client/server, open source, and traditional > software development and mixed operating system support > for business, education, and science > Phone: 847.412.0713 http://www.kappacs.com > >