find and replace, and other questions
Kurt Bigler <kkb-qsUyPSV3HvqUK90frp/[email protected]> Sun, 12 Dec 2010 00:13:51 -0800
| Newsgroups | gmane.mail.spam.crm114 |
|---|---|
| Message-ID | <C929C43F.2B997%[email protected]> |
Back after years away. Not much going on here it seems.
I got stuck years ago when I could not manage the transition to mailreaver
which did not fit within my framework. I didn't have time to rework
everything, so gave up on doing any more upgrades. Now I can give it a
little burst of effort.
To the point:
I am trying to understand how (if at all possible) to do regex stuff with an
LHS and an RHS, i.e. "find and replace" with regex on the LHS and \1 \2 \3
etc. on the RHS. Is this even supported? Or is \1 only useful to indicate
repetition of a substring in the LHS?
Doc on ALTER has this little statement about expanding \-constants but I'm
not sure what that means, maybe just octal constants, etc.
I was hoping that MATCH would set some magic variables that ALTER could
reference via \1 \2 \3 etc. (It certainly seems like match and alter
*could* be made to do that.)
Even if I had to do something like
match /blah/ [ :: :_dw0: :_dw1: :_dw2: :_dw3: ]
combined with a convention that let alter use \N to reference these
variables.
Reason: I want to use \1 \2 \3 in the RHS of rewrite rules. This seems a
lot cleaner than hacking mailfilter.crm, pushing the rewrite functionality
there to get more expressiveness. I'm sure I could find some way hack the
rewrite rule code to accomplish this but it probably requires adding more
levels of evaluation which might hurt performance.
In short I wanted to use rewrite rules to accomplish substitutions that
would facilitate classification, e.g. by parsing URLs differently,
recognizing punctuation in the middle of words, etc. It seemed like the
really clean place to put such functionality.
Any clues?
At the same time it seemes a little tricky to use such substitutions in a
way that has significant power with OSB, i.e. without at least some
trigrams. (Maybe that needs some explanation, but for now I'll just throw
it out.) Makes me wish for a classification method that would let me
enumerate the N-grams I want to include in training and classification.
Since they are enumerable, just a list of integers would do the trick,
together with a handy reference table of the relevant canonical
permutations.
Does the OSB code really depend on everything being bigrams?
Meanwhile I have some tricks in mind to make the best of bigrams for this,
but thought I'd ask whether anyone else has come to think bigrams are a
little bit limiting, even while the more general set of -grams may be
overkill.
Hello again, and thanks for any thoughts!
-Kurt
------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev