diff options
author | Andres Rey <[email protected]> | 2017-11-12 00:01:09 +0000 |
---|---|---|
committer | Andres Rey <[email protected]> | 2017-11-12 00:01:09 +0000 |
commit | 00ab1e503a7d804a19365ffe3ee19cd9ca9f8643 (patch) | |
tree | e154e415402cd80f2621f09d14813697c3ca5730 /src | |
parent | c54c64e937aa7e49111618776784f0f8acfdd3c6 (diff) |
Minor fix when pushing results to the $alternativeCandidateAncestors array
Diffstat (limited to 'src')
-rw-r--r-- | src/HTMLParser.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/HTMLParser.php b/src/HTMLParser.php index 8c3c204..5589e83 100644 --- a/src/HTMLParser.php +++ b/src/HTMLParser.php @@ -853,9 +853,9 @@ class HTMLParser // Find a better top candidate node if it contains (at least three) nodes which belong to `topCandidates` array // and whose scores are quite closed with current `topCandidate` node. $alternativeCandidateAncestors = []; - for ($i = 0; $i < count($topCandidates); $i++) { + for ($i = 1; $i < count($topCandidates); $i++) { if ($topCandidates[$i]->getContentScore() / $topCandidate->getContentScore() >= 0.75) { - $alternativeCandidateAncestors[$i] = $topCandidates[$i]->getNodeAncestors(false); + array_push($alternativeCandidateAncestors, $topCandidates[$i]->getNodeAncestors(false)); } } |