Update of /cvsroot/monetdb/pathfinder/modules/pftijah
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12332

Modified Files:
        nexi.c pftijah.mx 
Log Message:
- Implementation of TIJAH update functions in Pathfinder. These implementations
  are implemented using the 'docmgmt' type. They do not produce a docmgmt tape
  like the pf:add-doc() function but the create an empty tape. The update is
  perfromed within the milprint_summer function.
  The functions created are:

  pf:tijah-create-collection(collName:string [,options:item]) as docmgmt
  pf:tijah-delete-collection(collName:string) as docmgmt
  pf:tijah-add-doc(collName:string, uri:string) as docmgmt
  pf:tijah-add-doc(collName:string, uri:string[, name:string]) as docmgmt

An example of a PFTIJAH collection creation + addition of the documents +
deletion of the collection again in one statement (so an expensive  null op:-):

let $coll := "C"
let $dir  := "/home/flokstra/scripts/DATA/"
let $docs := (  "dilbert.xml",
                "number.xml",
                "number_two.xml"
             )
return (
  pf:tijah-create-collection(
        $coll,
        <TijahOptions
                tokenizer="fast"
                stemmer="porter-english"
        />
  ),
  for $d in $docs
        return pf:tijah-add-doc($coll,fn:concat($dir,$d),$d)
  ,
  pf:tijah-delete-collection($coll)
)



Index: nexi.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/nexi.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- nexi.c      1 Mar 2007 11:26:30 -0000       1.51
+++ nexi.c      2 Mar 2007 14:39:47 -0000       1.52
@@ -597,6 +597,7 @@
     else
         phrase_in = FALSE;
 
+    parserCtx->milFILEdesc = NULL;
     if ( parserCtx->milFILEname ) {
       if ( !(parserCtx->milFILEdesc = fopen(parserCtx->milFILEname,"w")) ) {
         LOGPRINTF(LOGFILE,"Error: cannot find file for writing mil code.\n");
@@ -628,8 +629,6 @@
     LOGPRINTF(LOGFILE,"\tGenerated MIL in string, 
size=%d\n",strlen(parserCtx->milBUFF));
      if ( parserCtx->milFILEdesc ) {
        fprintf(parserCtx->milFILEdesc,"%s",parserCtx->milBUFF);
-     }
-     if ( parserCtx->milFILEdesc ) {
        fclose(parserCtx->milFILEdesc);
      }
 

Index: pftijah.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/pftijah.mx,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- pftijah.mx  2 Mar 2007 07:53:50 -0000       1.101
+++ pftijah.mx  2 Mar 2007 14:39:48 -0000       1.102
@@ -390,7 +390,7 @@
       var tagfilter  := "";
   
       [EMAIL PROTECTED]() {
-         if ( verbose ) printf("#TJ: 
tj_init_global():param[%s]=\"%s\"\n",$h,$t);
+         if ( verbose ) printf("#TJ: 
tj_init_collection():param[%s]=\"%s\"\n",$h,$t);
          if ( $h = "stemmer" ) {
              stemmer := $t;
          } else if ( $h = "tokenizer" ) {
@@ -521,6 +521,9 @@
 # a single [void,bat] bat
 PROC _tj_collection(str collName) : BAT[str, bat]
 {
+        if (not(view_bbp_name().reverse().exist("tj_" + collName + "_param"))) 
{
+            ERROR("_tj_collection(): collection(\""+collName+"\") does not 
exist!\n");
+       }
        var tjCollBat := new(str,bat);
 
        var parbat := bat("tj_" + collName + "_param");
@@ -586,6 +589,7 @@
 "pftijah");
 PROC tj_add2collection(str collName, str uri_loc, str uri_name, bit store) : 
void
 {
+    if ( verbose ) printf("#TJ: tj_add2collection(\"%s\",\"%s\",\"%s\") 
start.\n",collName,uri_loc,uri_name);
     var coll_lock := tj_get_collection_lock(collName);
     lock_set(coll_lock);
     var err := CATCH({


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to