Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ClusterParam.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2001 Carnegie Mellon University.  All Rights Reserved.
00003  *
00004  * Use of the Lemur Toolkit for Language Modeling and Information Retrieval
00005  * is subject to the terms of the software license set forth in the LICENSE
00006  * file included with this software, and also available at
00007  * http://www.lemurproject.org/license.html
00008  *
00009  *==========================================================================
00010  */
00011 
00012 #ifndef _CLUSTERPARAMETER_HPP
00013 #define _CLUSTERPARAMETER_HPP
00014 
00015 #include "Param.hpp"
00017 namespace ClusterParam {
00019   enum simTypes {COS=1};
00021   enum clusterTypes {AGGLOM=1, CENTROID=2};
00023   enum docModes {DMAX=1, DMEAN=2, DAVE=3, DMIN=4};
00024   
00026 
00027 
00028   static std::string databaseIndex;
00030   static std::string clusterIndex;
00032   static std::string clusterDBType;
00034   static enum clusterTypes clusterType;
00036   static enum docModes docMode;
00038   static double threshold;
00040   static int numParts;
00042   static int maxIters;
00044   static int numIters;
00046   static enum simTypes simType;
00048 
00049   static void get() {
00050     databaseIndex = lemur::api::ParamGetString("index","");
00051     clusterIndex = lemur::api::ParamGetString("clusterIndex","clusterIndex");
00052     clusterDBType = lemur::api::ParamGetString("clusterDBType","flatfile");
00053     string clusterTypeString = lemur::api::ParamGetString("clusterType",
00054                                                           "centroid");
00055     if (clusterTypeString == "centroid") {
00056       clusterType = CENTROID;
00057     } else if (clusterTypeString == "agglomerative") {
00058       clusterType = AGGLOM;
00059     } else {
00060       cerr << "Unknown clusterType " << clusterTypeString <<
00061         " using centroid." << endl;
00062       clusterType = CENTROID;
00063     }
00064     string simTypeString = lemur::api::ParamGetString("simType","COS");
00065     if (simTypeString == "COS" || simTypeString == "cos") {
00066       simType = COS;
00067     } else {
00068       cerr << "Unrecognized simType " << simTypeString << " using cos." 
00069            << endl;
00070       simType = COS;
00071     }
00072     string docModeString = lemur::api::ParamGetString("docMode", "max");
00073     if (docModeString == "max") {
00074       docMode = DMAX;
00075     } else if (docModeString == "mean") {
00076       docMode = DMEAN;
00077     } else if (docModeString == "min") {
00078       docMode = DMIN;
00079     } else if (docModeString == "avg") {
00080       docMode = DAVE;
00081     } else {
00082       cerr << "Unrecognized docMode " << docModeString << " using max." 
00083            << endl;
00084       docMode = DMAX;
00085     }
00086     threshold = lemur::api::ParamGetDouble("threshold", 0.25);
00087     numParts = lemur::api::ParamGetInt("numParts", 2);
00088     maxIters = lemur::api::ParamGetInt("maxIters", 100);
00089     numIters = lemur::api::ParamGetInt("bkIters", 5);
00090   }
00091 }
00092 
00093 #endif

Generated on Tue Jun 15 11:02:53 2010 for Lemur by doxygen 1.3.4