Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vimazeno
mobipaleo
Commits
50d23fdc
Commit
50d23fdc
authored
Mar 23, 2022
by
Vincent Mazenod
Browse files
retrieve columns throuh consecutive tids
parent
5ca953c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Commands/MiningCommand.php
View file @
50d23fdc
...
...
@@ -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
);
...
...
src/Services/ConstraintMiningConsecutiveWithTids.php
View file @
50d23fdc
...
...
@@ -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
]
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment