Changeset 4048:6bb10e9d8631 in orange


Ignore:
Timestamp:
08/04/07 14:48:16 (7 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
05075465b414d662a201c590d2f98ae0f2446645
Message:
  • fixed the problem with setting DC representation for individual attributes (in tab-delimited files) by removing the useless feature altogether ;)
Location:
source/orange
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • source/orange/domaindepot.hpp

    r4044 r4048  
    5757    TStringList fixedOrderValues; // these have a fixed order 
    5858    set<string> values; // all values, sorted alpabetically 
    59     vector<string> DCs; 
    6059     
    6160    TAttributeDescription(const string &, const int &, const string &, bool = false); 
  • source/orange/tabdelim.cpp

    r4044 r4048  
    5757: TFileExampleGenerator(old), 
    5858  attributeTypes(mlnew TIntList(old.attributeTypes.getReference())), 
    59   DCs(old.DCs), 
    6059  classPos(old.classPos), 
    6160  headerLines(old.headerLines), 
     
    6766: TFileExampleGenerator(afname, PDomain()), 
    6867  attributeTypes(mlnew TIntList()), 
    69   DCs(), 
    7068  DK(aDK ? strcpy((char *)malloc(strlen(aDK)+1), aDK) : NULL), 
    7169  DC(aDC ? strcpy((char *)malloc(strlen(aDC)+1), aDC) : NULL), 
     
    7472  csv(acsv) 
    7573{  
    76   // domain needs to be initialized after attributeTypes, DCs, classPos, headerLines 
     74  // domain needs to be initialized after attributeTypes, classPos, headerLines 
    7775  domain = readDomain(afname, autoDetect, createNewOn, status, metaStatus, noCodedDiscrete, noClass); 
    7876 
     
    126124  vector<string>::iterator ai(atoms.begin()); 
    127125  TIntList::iterator si(attributeTypes->begin()), se(attributeTypes->end()); 
    128   vector<vector<string> >::iterator dci(DCs.begin()), dce(DCs.end()); 
    129126  int pos=0; 
    130127  for (; (si!=se); pos++, si++, ai++) { 
     
    134131      // Check for don't care 
    135132      valstr = *ai; 
    136       if (dci != dce) 
    137         ITERATE(vector<string>, dcii, *dci) 
    138           if (*dcii == valstr) { 
    139             valstr = '?'; 
    140             break; 
    141           } 
    142  
    143       if (!valstr.length() || (valstr == "NA") || (valstr == ".") || (DC && (valstr == DC))) 
     133      if (!valstr.length() || (DC && valstr == DC)) 
    144134        valstr = "?"; 
    145       else if ((valstr == "*") || (DK && (valstr == DK))) 
     135      else if (DK && (valstr == DK)) 
    146136        valstr = "~"; 
    147137 
     
    179169      } 
    180170    } 
    181  
    182     if (dci != dce) 
    183       dci++; 
    184171  } 
    185172 
     
    406393    const char *ceni = vli->c_str(); 
    407394    if (   !*ceni 
    408         || !ceni[1] && ((*ceni=='?') || (*ceni=='.') || (*ceni=='~') || (*ceni=='*') || (*ceni=='-')) 
    409         || (*vli == "NA") || (DC && (*vli == DC)) || (DK && (*vli == DK))) 
     395        || !ceni[1] && ((*ceni=='?') || (*ceni=='~') || (DC && (*vli == DC)) || (DK && (*vli == DK)))) 
    410396      continue; 
    411397     
     
    490476      const char *ceni = ai->c_str(); 
    491477      if (   !*ceni 
    492           || !ceni[1] && ((*ceni=='?') || (*ceni=='.') || (*ceni=='~') || (*ceni=='*') || (*ceni=='-')) 
    493           || (*ai == "NA") || (DC && (*ai == DC)) || (DK && (*ai == DK))) 
     478          || !ceni[1] && ((*ceni=='?') || (*ceni=='~') || (DC && (*ai == DC)) || (DK && (*ai == DK)))) 
    494479         continue; 
    495480 
     
    622607 
    623608    bool ordered = false; 
    624     vector<string> thisDCs; 
    625609 
    626610    if (fi!=fe) { 
     
    648632      ITERATE(TMultiStringParameters, mi, args.options) 
    649633        if ((*mi).first == "dc") 
    650           thisDCs.push_back((*mi).second); 
     634          raiseWarning("argument -dc is not supported any more"); 
    651635 
    652636      ordered = args.exists("ordered"); 
  • source/orange/tabdelim.hpp

    r4044 r4048  
    6969  PIntList attributeTypes; //P types of attributes (-1 normal, 0 skip, <-1 = meta ID) 
    7070 
    71   vector<vector<string> > DCs; // DC symbol(s) for each attribute 
    72   char *DK; // general character that denotes DK 
    73   char *DC; // general character that denotes DC 
     71  char *DK; //P general character that denotes DK 
     72  char *DC; //P general character that denotes DC 
    7473  int classPos; //P position of the class attribute 
    7574  int basketPos; //P position of the (virtual) basket attribute 
Note: See TracChangeset for help on using the changeset viewer.