00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _CLUSTERPARAMETER_HPP
00013 #define _CLUSTERPARAMETER_HPP
00014
00016 #include "Param.hpp"
00018 namespace ClusterParam {
00019 enum simTypes {COS=1};
00020 enum clusterTypes {AGGLOM=1, CENTROID=2};
00021 enum docModes {DMAX=1, DMEAN=2, DAVE=3, DMIN=4};
00022
00024
00025
00026 static String databaseIndex;
00028 static String clusterIndex;
00030 static String clusterDBType;
00032 static enum clusterTypes clusterType;
00034 static enum docModes docMode;
00036 static double threshold;
00038 static int numParts;
00040 static int maxIters;
00042 static int numIters;
00044 static enum simTypes simType;
00046
00047 static void get() {
00048 databaseIndex = ParamGetString("index","");
00049 clusterIndex = ParamGetString("clusterIndex","");
00050 clusterDBType = ParamGetString("clusterDBType","flatfile");
00051 string clusterTypeString = ParamGetString("clusterType","centroid");
00052 if (clusterTypeString == "centroid") {
00053 clusterType = CENTROID;
00054 } else if (clusterTypeString == "agglomerative") {
00055 clusterType = AGGLOM;
00056 } else {
00057 cerr << "Unknown clusterType " << clusterTypeString <<
00058 " using centroid." << endl;
00059 clusterType = CENTROID;
00060 }
00061 string simTypeString = ParamGetString("simType","COS");
00062 if (simTypeString == "COS" || simTypeString == "cos") {
00063 simType = COS;
00064 } else {
00065 cerr << "Unrecognized simType " << simTypeString << " using cos."
00066 << endl;
00067 simType = COS;
00068 }
00069 string docModeString = ParamGetString("docMode", "max");
00070 if (docModeString == "max") {
00071 docMode = DMAX;
00072 } else if (docModeString == "mean") {
00073 docMode = DMEAN;
00074 } else if (docModeString == "min") {
00075 docMode = DMIN;
00076 } else if (docModeString == "avg") {
00077 docMode = DAVE;
00078 } else {
00079 cerr << "Unrecognized docMode " << docModeString << " using max."
00080 << endl;
00081 docMode = DMAX;
00082 }
00083 threshold = ParamGetDouble("threshold", 0.25);
00084 numParts = ParamGetInt("numParts", 2);
00085 maxIters = ParamGetInt("maxIters", 100);
00086 numIters = ParamGetInt("bkIters", 5);
00087 }
00088 };
00089
00090 #endif