Skip to content

Commit

Permalink
WIP step 2
Browse files Browse the repository at this point in the history
- KDClassBuilder
  - supression des methodes Set|GetInterpretableNames, maintenant gere par KWClass
  - impacts dans KDTextFeatureConstruction et KDClassBuilder
  • Loading branch information
marcboulle committed Dec 6, 2023
1 parent d7d9698 commit 0c69dc4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 25 deletions.
10 changes: 5 additions & 5 deletions src/Learning/KDDomainKnowledge/KDClassBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
11 changes: 0 additions & 11 deletions src/Learning/KDDomainKnowledge/KDConstructionDomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ KDConstructionDomain::KDConstructionDomain()
InitializeStandardConstructionRules();
SelectDefaultConstructionRules();
nSparseBlockMinSize = 0;
bInterpretableNames = true;
bRuleOptimization = true;
bSparseOptimization = true;
bImportAttributeConstructionCosts = false;
Expand All @@ -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;
Expand Down
11 changes: 5 additions & 6 deletions src/Learning/KDDomainKnowledge/KDConstructionDomain.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/Learning/KDDomainKnowledge/KDTextFeatureConstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand All @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 0c69dc4

Please sign in to comment.