Function stringToRule(Rule&, const std::string&, const std::regex&, const std::regex&, bool, bool, DataSetFid&)

Function Documentation

bool stringToRule(Rule &rule, const std::string &str, const std::regex &attributePattern, const std::regex &classPattern, bool withAttributeNames, bool withClassNames, DataSetFid &dataset)

Converts a well-formatted rule string to a Rule object.

Parameters:
  • rule – The generated rule.

  • str – The string rule to convert.

  • attributePattern – The regex pattern to match attribute names or ids.

  • classPattern – The regex pattern to match class names or ids.

  • withAttributeNames – Whether the rule contains attribute names.

  • withClassNames – Whether the rule contains class names.

  • dataset – The dataset containing information about the attributes and classes.

Returns:

Returns true if the rule is created, false otherwise.