generateInvertedFile.cc

Go to the documentation of this file.
00001 /***************************************
00002 *
00003 * generateInvertedFile 
00004 *
00005 * creates an inverted file at the using the 
00006 * files 
00007 *
00008 ****************************************
00009 *
00010 * modification history:
00011 *
00012 * WM 991213 created the file
00013 *
00014 ****************************************
00015 *
00016 * compiler defines used:
00017 *
00018 * QUERY
00019 *
00020 ****************************************/
00021 
00022 #include "libMRML/include/mrml_const.h"
00023 #include "libMRML/include/CXMLElement.h"
00024 #include "libGIFTAcInvertedFile/include/CAcIFFileSystem.h"
00025 
00026 /***************************************
00027 *
00028 * main - main program, that reads the parameters and 
00029 *        executes the creation of the inverted file 
00030 *
00031 ****************************************
00032 *
00033 * modification history
00034 *
00035 * 
00036 *
00037 ****************************************/
00038 
00039 CMutex* gMutex(new CMutex());
00040 
00041 main(int argc,
00042      char** argv){
00043 
00044   if(argc==2){
00045     /* reading the parameters */
00046     string lPrefix(argv[1]);
00047     string lURL2FTS(lPrefix+"/url2fts.xml");
00048     string lFeatureDescription(lPrefix+"/InvertedFileFeatureDescription.db");
00049 
00050     cout << "Creating an inverted file using the files"
00051    << lPrefix << endl
00052    << lURL2FTS << endl
00053    << lFeatureDescription << endl
00054    << endl
00055    << flush;
00056     
00057     CXMLElement lElement(mrml_const::collection,
00058        0);
00059 
00060     lElement.addAttribute(mrml_const::cui_base_dir,
00061         lPrefix);      
00062     lElement.addAttribute(mrml_const::cui_feature_file_location,
00063         "url2fts.xml");
00064     lElement.addAttribute(mrml_const::cui_feature_description_location,
00065         "InvertedFileFeatureDescription.db");
00066     lElement.addAttribute(mrml_const::cui_inverted_file_location,
00067         "InvertedFile.db");
00068     lElement.addAttribute(mrml_const::cui_offset_file_location,
00069         "InvertedFileOffset.db");
00070     lElement.addAttribute(mrml_const::cui_generate_inverted_file,
00071         "yes");
00072 
00073     CAcIFFileSystem lAccessor(lElement);
00074 
00075     if(lAccessor){
00076       cout << "GENERATED inverted file" 
00077      << endl
00078      << flush;
00079       
00080     }else{
00081       cout << "ERROR in generating inverted file";
00082     }
00083   }else{
00084     
00085     cout << "USAGE: "
00086    << argv[0] 
00087    << " " 
00088    << "[inverted file directory]";
00089 
00090 
00091   }
00092 }
00093 
00094 
00095 
00096 

Generated on Wed Jan 7 00:30:37 2009 for Gift by  doxygen 1.5.6