Esempio n. 1
0
 void get() {
   outFile = ParamGetString("outputFile");
   stopwords = ParamGetString("stopwords");
   acronyms = ParamGetString("acronyms");
   docFormat = ParamGetString("docFormat");
   stemmer = ParamGetString("stemmer");
 }
Esempio n. 2
0
 void get() {
   // the string with quotes are the actual variable names to use for specifying the parameters
   databaseIndex    = ParamGetString("index"); 
   queryStream      = ParamGetString("query");
   resultFile       = ParamGetString("result","res");
   weightScheme     = ParamGetString("weightScheme","RawTF");
   resultCount      = ParamGetInt("resultCount", 100); 
 }    
 void get() {
   index = ParamGetString("index");
   indexType = ParamGetString("indexType");
   manager = ParamGetString("manager");
   mgrType = ParamGetString("managerType");
   memory = ParamGetInt("memory", 128000000);
   stopwords = ParamGetString("stopwords");
   acronyms = ParamGetString("acronyms");
   docFormat = ParamGetString("docFormat");
   dataFiles = ParamGetString("dataFiles");
   stemmer = ParamGetString("stemmer");
   countStopWords = (ParamGetString("countStopWords", "false") == "true");
 }
	void get()
	{
		resultFile = ParamGetString("resultFile");
		testFile = ParamGetString("testFile");
		priorFile = ParamGetString("priorFile");
		smoothingParam = ParamGetDouble("smoothingParam", 0.5);
		dirParamNN = ParamGetDouble("dirParamNN", 100);
		splitLimit = ParamGetInt("splitLimit", 5000);
		minLongitudeStep = ParamGetDouble("minLongitudeStep", 0.01);
		minLatitudeStep = ParamGetDouble("minLatitudeStep", 0.01);
		std::string s = ParamGetString("excludeTestUsers","false");
		excludeTestUsers = (s.compare("false")==0) ? false : true;

		geoTermThreshold = ParamGetDouble("geoTermThreshold",-1.0);
		generalUseTermFilter = ParamGetInt("generalUseTermFilter",-1);
		defaultLatitude = ParamGetDouble("defaultLatitude", 0.0);
		defaultLongitude = ParamGetDouble("defaultLongitude", 0.0);

		fields = ParamGetString("fields");
		alphas = ParamGetString("alphas");

		geoTermThresholdFile = ParamGetString("geoTermThresholdFile");

		takenInMonth = ParamGetInt("takenInMonth",-1);

		modulosOp = ParamGetInt("modulosOp",1);//if fewer training docs should be used, modulosOp>1

		termFile = ParamGetString("termFile","");
	}
Esempio n. 5
0
lemur::api::Stemmer* lemur::api::TextHandlerManager::createStemmer(string type, string datadir, string func) {
  Stemmer *stemmer = NULL;
  if (type.empty()) {
    // didn't pass in type, try to get it from the paramstack
    type = ParamGetString("stemmer");
  }  

  // if it's still empty, return nothing
  if (type.empty())
    return NULL;

  // make it all lowercase
  for (int i=0;i<type.length();i++)
    type[i] = tolower(type[i]);

  try {
    if (type == lemur::parse::KStemmer::identifier) {
      stemmer = new lemur::parse::KStemmer();
      //      cerr << "created Kstemmer" << endl;
    } else if (type == lemur::parse::PorterStemmer::identifier) {
      stemmer = new lemur::parse::PorterStemmer();
      //cerr << "created porter stemmer" << endl;
    }
  } catch (Exception &ex) {
    LEMUR_RETHROW(ex, "Could not create Stemmer");
  }
  
  return stemmer;
}
	void get()
	{
		resultFile = ParamGetString("resultFile");
		splitLimit = ParamGetInt("splitLimit", 5000);
		minLongitudeStep = ParamGetDouble("minLongitudeStep", 0.01);
		minLatitudeStep = ParamGetDouble("minLatitudeStep", 0.01);
		minAccuracy = ParamGetInt("minAccuracy", 11);
		geoTermThreshold = ParamGetDouble("geoTermThreshold",-1.0);
		generalUseTermFilter = ParamGetInt("generalUseTermFilter",-1);
	}
Esempio n. 7
0
lemur::api::Parser* lemur::api::TextHandlerManager::createParser(string type, string acros) {  
  // Create the appropriate parser.
  Parser * parser = NULL;
  if (type.empty()) {
    // didn't pass in type, try to get it from the paramstack
    type = ParamGetString("docFormat");
  }

  // if it's still empty, return nothing
  if (type.empty())
    return NULL;

  // make it all lowercase
  for (int i=0;i<type.length();i++)
    type[i] = tolower(type[i]);
  
  if (type == lemur::parse::WebParser::identifier) {
    parser = new lemur::parse::WebParser();
  } else if (type == lemur::parse::TrecParser::identifier) {
    parser = new lemur::parse::TrecParser();
  } else if (type == lemur::parse::IdentifinderParser::identifier) {
    parser = new lemur::parse::IdentifinderParser();
  }
  
  if (parser) {
    // tell the parser about the acronyms list
    if (acros.empty()) {
      acros = ParamGetString("acronyms");
    }
    if (!acros.empty()) {
      parser->setAcroList(acros);
    }
  }

  return parser;
}
Esempio n. 8
0
lemur::api::Stopper* lemur::api::TextHandlerManager::createStopper(string filename) {
  Stopper* stopper = NULL;
  if (filename.empty()) 
    filename = ParamGetString("stopwords");

  if (!filename.empty()) {
    try {
      stopper = new Stopper(filename);
      //cerr << "created stopper" << endl;
    } catch (Exception &ex) {
      LEMUR_RETHROW(ex, "Could not create Stopper using file name");
    }
  }
  
  return stopper;
}
Esempio n. 9
0
 lemur::utility::String ParamGetString(const lemur::utility::String &s)
 {
   lemur::utility::String def = "";
   return ParamGetString(s, def);
 }
Esempio n. 10
0
 lemur::utility::String ParamGetString(const lemur::utility::String &s, lemur::utility::String &value, const lemur::utility::String &def)
 {
   value = ParamGetString(s, def);
   return value;
 }
Esempio n. 11
0
 void get() {
   expandedQuery = ParamGetString("expandedQuery");
 }
Esempio n. 12
0
 void get() {
   index = ParamGetString("index");
   L2File = ParamGetString("L2File");
 }