Commit 50d23fdc authored by Vincent Mazenod's avatar Vincent Mazenod
Browse files

retrieve columns throuh consecutive tids

parent 5ca953c7
......@@ -86,14 +86,6 @@ class MiningCommand extends Command {
$this->constraintMining->compute($job->getConstraintMining(), $job);
$memory = intval(memory_get_usage())-intval($memory);
$time = intval(hrtime(true))-intval($time);
$results = unserialize(
file_get_contents(
$this->datasheetsDir.'/'.$job->getOutputDatasheet()
)
);
dump($results);
$output->writeln("<bg=green> ✔ OK</> ".$filePath);
$output->writeln(" * constraint: ".$constraint);
......
......@@ -50,38 +50,22 @@ class ConstraintMiningConsecutiveWithTids
throw new ProcessFailedException($process);
}
$patterns = array_map(
function ($c) {
$regexp = preg_replace('/(.+)/','/${1}/', $c);
$regexp = str_replace("-", ".", $regexp);
return $regexp;
},
$job->getColumns()
);
$replacements = array_map(
function ($c) {
return $c+1;
},
array_keys($job->getColumns())
);
// structure results as array
$results = Array();
$data = file_get_contents($outputDatasheetPath);
$lines = explode("\n", $data);
$lines = array_slice($lines, 1, -4);
$job->setNbLines(count($lines));
foreach($lines as $k => $line)
{
$results[$k] = Array();
preg_match_all('/([\w\.]+=[\+|\-])/', $line, $columns);
$results[$k]['columns'] = array_map(
function ($c) use ($patterns, $replacements) {
$regexp = preg_replace($patterns, $replacements, $c);
$regexp = str_replace("=", "", $regexp);
return $regexp;
function ($c) {
$column = str_replace("X", "", $c);
$column = str_replace("=", "", $column);
return $column;
},
$columns[0]
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment