diff --git a/src/Learning/KDDomainKnowledge/KDClassBuilder.cpp b/src/Learning/KDDomainKnowledge/KDClassBuilder.cpp index 3f5486466..89e10808f 100644 --- a/src/Learning/KDDomainKnowledge/KDClassBuilder.cpp +++ b/src/Learning/KDDomainKnowledge/KDClassBuilder.cpp @@ -147,7 +147,7 @@ ALString KDClassBuilder::BuildConstructedAttributeName(const KDConstructedRule* require(GetConstructionDomain()->LookupConstructionRule(rule->GetName()) != NULL); // Construction d'un nom "interpretable" - if (GetConstructionDomain()->GetInterpretableNames()) + if (KWClass::GetInterpretableNames()) sAttributeName = rule->BuildAttributeName(false); // Numerotation des variables else @@ -164,7 +164,7 @@ ALString KDClassBuilder::BuildConstructedAttributeBlockName(const KDConstructedR require(GetConstructionDomain()->LookupConstructionRule(rule->GetName()) != NULL); // Construction d'un nom "interpretable" - if (GetConstructionDomain()->GetInterpretableNames()) + if (KWClass::GetInterpretableNames()) sAttributeName = rule->BuildAttributeName(true); // Numerotation des variables else @@ -180,7 +180,7 @@ ALString KDClassBuilder::BuildPartitionAttributeName(const KDConstructedPartitio require(GetConstructionDomain() != NULL); // Construction d'un nom "interpretable" - if (GetConstructionDomain()->GetInterpretableNames()) + if (KWClass::GetInterpretableNames()) sAttributeName = partition->BuildPartitionAttributeName(); // Numerotation des variables else @@ -196,7 +196,7 @@ ALString KDClassBuilder::BuildTablePartitionAttributeBlockName(const KDConstruct require(GetConstructionDomain() != NULL); // Construction d'un nom "interpretable" - if (GetConstructionDomain()->GetInterpretableNames()) + if (KWClass::GetInterpretableNames()) sAttributeName = partition->BuildTablePartitionAttributeBlockName(); // Numerotation des variables else @@ -212,7 +212,7 @@ ALString KDClassBuilder::BuildPartAttributeName(const KDConstructedPart* part) c require(GetConstructionDomain() != NULL); // Construction d'un nom "interpretable" - if (GetConstructionDomain()->GetInterpretableNames()) + if (KWClass::GetInterpretableNames()) sAttributeName = part->BuildPartAttributeName(); // Numerotation des variables else diff --git a/src/Learning/KDDomainKnowledge/KDConstructionDomain.cpp b/src/Learning/KDDomainKnowledge/KDConstructionDomain.cpp index 4faa1e535..819fdd889 100644 --- a/src/Learning/KDDomainKnowledge/KDConstructionDomain.cpp +++ b/src/Learning/KDDomainKnowledge/KDConstructionDomain.cpp @@ -11,7 +11,6 @@ KDConstructionDomain::KDConstructionDomain() InitializeStandardConstructionRules(); SelectDefaultConstructionRules(); nSparseBlockMinSize = 0; - bInterpretableNames = true; bRuleOptimization = true; bSparseOptimization = true; bImportAttributeConstructionCosts = false; @@ -27,16 +26,6 @@ KDConstructionDomain::~KDConstructionDomain() odConstructionRules.DeleteAll(); } -boolean KDConstructionDomain::GetInterpretableNames() const -{ - return bInterpretableNames; -} - -void KDConstructionDomain::SetInterpretableNames(boolean bValue) -{ - bInterpretableNames = bValue; -} - boolean KDConstructionDomain::GetRuleOptimization() const { return bRuleOptimization; diff --git a/src/Learning/KDDomainKnowledge/KDConstructionDomain.h b/src/Learning/KDDomainKnowledge/KDConstructionDomain.h index 61522f035..df9331bac 100644 --- a/src/Learning/KDDomainKnowledge/KDConstructionDomain.h +++ b/src/Learning/KDDomainKnowledge/KDConstructionDomain.h @@ -20,11 +20,11 @@ class KDConstructionDomain : public Object KDConstructionDomain(); ~KDConstructionDomain(); - // Nommage des variables de facon interpretable - // . true (defaut): un nom parlant est cree - // . false: les variables sont nommee par numerotation - boolean GetInterpretableNames() const; - void SetInterpretableNames(boolean bValue); + ////////////////////////////////////////////////////////////// + // Parametrage de la construction de variables + // + // La gestion des nom de variables interpretable est parametree de facon + // generique dans la methode KWClass::GetInterpretableNames // Optimisation de la classe construite par creation de variables intermediaires (defaut: true) boolean GetRuleOptimization() const; @@ -118,7 +118,6 @@ class KDConstructionDomain : public Object // Parametres generaux de la construction de variables int nSparseBlockMinSize; - boolean bInterpretableNames; boolean bRuleOptimization; boolean bSparseOptimization; boolean bImportAttributeConstructionCosts; diff --git a/src/Learning/KDDomainKnowledge/KDTextFeatureConstruction.cpp b/src/Learning/KDDomainKnowledge/KDTextFeatureConstruction.cpp index 6732b3328..ae9cab5eb 100644 --- a/src/Learning/KDDomainKnowledge/KDTextFeatureConstruction.cpp +++ b/src/Learning/KDDomainKnowledge/KDTextFeatureConstruction.cpp @@ -1124,7 +1124,7 @@ const ALString KDTextFeatureConstruction::BuildMainTextAttributeName(const KDTex require(textAttributePath->GetAttributePathSize() > 1); // Construction d'un nom "interpretable" - if (GetConstructionDomain()->GetInterpretableNames()) + if (KWClass::GetInterpretableNames()) { for (i = 0; i < textAttributePath->GetAttributePathSize(); i++) { @@ -1147,7 +1147,7 @@ const ALString KDTextFeatureConstruction::BuildTokenBasedAttributeName(const KWA require(textAttribute != NULL); // Construction d'un nom "interpretable" - if (GetConstructionDomain()->GetInterpretableNames()) + if (KWClass::GetInterpretableNames()) { // Construction du nom de variable a partir des caracteristiques du token sAttributeName = textAttribute->GetName(); @@ -1174,7 +1174,7 @@ const ALString KDTextFeatureConstruction::BuildTokenBasedAttributeBlockName(cons require(textAttribute != NULL); // Construction d'un nom "interpretable" - if (GetConstructionDomain()->GetInterpretableNames()) + if (KWClass::GetInterpretableNames()) { // Construction du nom de variable a partir des caracteristiques du ngram sAttributeName = textAttribute->GetName();