Update of /cvsroot/monetdb/MonetDB5/src/modules/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8000
Modified Files:
Makefile.ag mal_init.mx
Added Files:
txtsim.mx
Log Message:
Add module txtsim (it is translation from the one existent in M4).
Update the Makefile to compile it and also add it to the mal_init.
This module will be used by SQL for the functions:
sql_create_func("soundex", "calc", "soundex", *t, NULL, *t, SCALE_NONE);
sql_create_func("difference", "calc", "stringdiff", *t, *t, INT, SCALE_NONE);
sql_create_func("editdistance", "calc", "editdistance", *t, *t, INT, SCALE_FIX);
sql_create_func("editdistance2", "calc", "editdistance2", *t, *t, INT,
SCALE_FIX);
sql_create_func("similarity", "calc", "similarity", *t, *t, DBL, SCALE_FIX);
sql_create_func("qgramnormalize", "calc", "qgramnormalize", *t, NULL, *t,
SCALE_NONE);
sql_create_func("levenshtein", "calc", "levenshtein", *t, *t, INT, SCALE_FIX);
Note: The module is loaded by mserver without syntax and type errors.
The file contains commented MIL plus the respective MAL translation. This
is for the MIL to MAL experts check if the translation is correct.
Index: Makefile.ag
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/Makefile.ag,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -d -r1.110 -r1.111
--- Makefile.ag 3 Dec 2007 08:24:47 -0000 1.110
+++ Makefile.ag 10 Dec 2007 21:23:58 -0000 1.111
@@ -31,7 +31,7 @@
inspect.mx manual.mx \
factory.mx mdb.mx \
urlbox.mx mat.mx \
- sabaoth.mx remote.mx batxml.mx
+ sabaoth.mx remote.mx batxml.mx txtsim.mx
#radix.mx
LIBS = ../../mal/libmal ../atoms/lib_xml $(MONETDB_LIBS) -lbat -lstream
$(MATH_LIBS) \
@@ -165,7 +165,7 @@
factory.mx mdb.mx pcre.mx tablet.mx mat.mx \
urlbox.mx statistics.mx transaction.mx \
mserver.mx sabaoth.mx remote.mx \
- bpm.mx batxml.mx
+ bpm.mx batxml.mx txtsim.mx
#radix.mx
}
--- NEW FILE: txtsim.mx ---
@' The contents of this file are subject to the MonetDB Public License
@' Version 1.1 (the "License"); you may not use this file except in
@' compliance with the License. You may obtain a copy of the License at
@' http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
@'
@' Software distributed under the License is distributed on an "AS IS"
@' basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
@' License for the specific language governing rights and limitations
@' under the License.
@'
@' The Original Code is the MonetDB Database System.
@'
@' The Initial Developer of the Original Code is CWI.
@' Portions created by CWI are Copyright (C) 1997-2007 CWI.
@' All Rights Reserved.
@f txtsim
@t Module providing similarity metrics for strings
@a Romulo Goncalves (from M4 to M5)
[...1035 lines suppressed...]
sel := algebra.select(b, [EMAIL PROTECTED], id);
mrk := algebra.markT(sel, [EMAIL PROTECTED]);
c1 := bat.reverse(mrk);
# var c2 := b.select([EMAIL PROTECTED], oid(b.count() - 1)).mark([EMAIL
PROTECTED]).reverse();
cnt := aggr.count(alg);
cnt := calc.-(cnt,1);
id := calc.oid(cnt);
sel := algebra.select(b, [EMAIL PROTECTED], id);
mrk := algebra.markT(sel, [EMAIL PROTECTED]);
c2 := bat.reverse(mrk);
# return [+](c0, [+](c1, c2));
#}
res := batcalc.+(c1, c2);
res := batcalc.+(c0, res);
return res;
end str2qgrams;
@}
Index: mal_init.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/mal_init.mx,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- mal_init.mx 4 Oct 2007 13:06:20 -0000 1.122
+++ mal_init.mx 10 Dec 2007 21:23:58 -0000 1.123
@@ -87,6 +87,7 @@
library optimizer;
library chopper;
+library txtsim;
#library logger;
library transaction;
@@ -198,6 +199,7 @@
include opt_trace;
include chopper;
+include txtsim;
#include logger;
include transaction;
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins