Skip to content

[template] Arguments substititation, class arguments checking, arguments in params duplication#41

Open
NikitaZotov wants to merge 5 commits intomainfrom
feat/sc_template_search
Open

[template] Arguments substititation, class arguments checking, arguments in params duplication#41
NikitaZotov wants to merge 5 commits intomainfrom
feat/sc_template_search

Conversation

@NikitaZotov
Copy link
Copy Markdown
Member

Fixes:

  • arguments substititation,
  • class arguments checking,
  • arguments in params duplication.

@NikitaZotov NikitaZotov self-assigned this Jan 30, 2023
@NikitaZotov NikitaZotov added bug Something isn't working 0.2.0 labels Jan 30, 2023
@NikitaZotov NikitaZotov added this to the 0.2.0 milestone Jan 30, 2023
Copy link
Copy Markdown
Member

@MksmOrlov MksmOrlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Add tests
  2. Update documentation, changelog
  3. Fix commit and branch naming style

@NikitaZotov NikitaZotov force-pushed the feat/sc_template_search branch from 3bc4b24 to 952d33e Compare January 30, 2023 10:05
@NikitaZotov NikitaZotov changed the title fix(template-manager): arguments substititation, class arguments checking, arguments in params duplication [template] Arguments substititation, class arguments checking, arguments in params duplication Jan 30, 2023
for (ScAddr const & argument : argumentList) // this block is executed if inputStructure is valid
ScIterator5Ptr const & classesIterator = context->Iterator5(
ScType::NodeConstClass, ScType::EdgeAccessVarPosPerm, var, ScType::EdgeAccessConstPosPerm, scTemplate);
bool isBelong = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this var should be initialized with true. In that case replacements for variables without classes will be searched in arguments and not in input structure

@NikitaZotov NikitaZotov requested a review from MksmOrlov January 31, 2023 08:55
Copy link
Copy Markdown
Member

@kilativ-dotcom kilativ-dotcom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this test does not call TemplateManager::createTemplateParams

Comment on lines +30 to +31
sc_node_class
-> concept_human;;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add sc_node_norole_relation for nrel_system_identifier and nrel_father

Comment on lines +1 to +15
@template = [*
_hum1
_=> nrel_father::
_hum2;;

_hum3
_=> nrel_father::
_hum2;;

concept_human
_-> _hum1;
_-> _hum3;;
*];;
@template
=> nrel_system_identifier: [search_template];;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not
search_template = [* .... *];;

Comment on lines +17 to +25
human_ivan_ivanov
<- concept_human;
=> nrel_father:
human_andrey_ivanov;;

human_pavel_ivanov
<- concept_human;
=> nrel_father:
human_andrey_ivanov;;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not andreevich?

Comment on lines +10 to +12
concept_human
_-> _hum1;
_-> _hum3;;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is human2 a person?

Comment on lines +108 to +111
std::string firstHuman = "human_ivan_ivanov";
std::string secondHuman = "human_pavel_ivanov";
std::string varHumanName1 = "_hum1";
std::string varHumanName3 = "_hum3";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make const

loader.loadScsFile(context, TEST_FILES_DIR_PATH + "searchWithContentEqualResultTestStucture.scs");
initialize();

ScAddr searchTemplateAddr = context.HelperFindBySystemIdtf(TEST_SEARCH_TEMPLATE_ID);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const &

for (ScAddr const & argument : argumentList) // this block is executed if inputStructure is valid
ScIterator5Ptr const & classesIterator = context->Iterator5(
ScType::NodeConstClass, ScType::EdgeAccessVarPosPerm, var, ScType::EdgeAccessConstPosPerm, scTemplate);
bool isBelong = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is belong what? Name variables clear

searchResults[0][searchLinkIdentifier] == context.HelperFindBySystemIdtf(secondCorrectResultLinkIdentifier));
}

TEST_F(TemplateSearchManagerTest, SearchWithContent_EqualResultTestCase)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no content in this template. Rename test and scs file for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.2.0 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants