Skip to content

Commit

Permalink
Rename articleByLine to articleByline - won't affect method calls usi…
Browse files Browse the repository at this point in the history
…ng old name because they're case insensitive in PHP
  • Loading branch information
fivefilters committed Nov 29, 2024
1 parent 37d6807 commit e03143c
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Then you pass this Configuration object to Readability. The following options ar

- **MaxTopCandidates**: default value `5`, max amount of top level candidates.
- **CharThreshold**: default value `500`, minimum amount of characters to consider that the article was parsed successful.
- **ArticleByLine**: default value `false`, search for the article byline and remove it from the text. It will be moved to the article metadata.
- **ArticleByline**: default value `false`, search for the article byline and remove it from the text. It will be moved to the article metadata.
- **StripUnlikelyCandidates**: default value `true`, remove nodes that are unlikely to have relevant information. Useful for debugging or parsing complex or non-standard articles.
- **CleanConditionally**: default value `true`, remove certain nodes after parsing to return a cleaner result.
- **WeightClasses**: default value `true`, weight classes during the rating phase.
Expand Down
10 changes: 5 additions & 5 deletions src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Configuration

protected int $maxTopCandidates = 5;
protected int $charThreshold = 500;
protected bool $articleByLine = false;
protected bool $articleByline = false;
protected bool $stripUnlikelyCandidates = true;
protected bool $cleanConditionally = true;
protected bool $weightClasses = true;
Expand Down Expand Up @@ -119,17 +119,17 @@ public function setCharThreshold(int $charThreshold): Configuration
/**
* Get article by line.
*/
public function getArticleByLine(): bool
public function getArticleByline(): bool
{
return $this->articleByLine;
return $this->articleByline;
}

/**
* Set article by line.
*/
public function setArticleByLine(bool $articleByLine): Configuration
public function setArticleByline(bool $articleByline): Configuration
{
$this->articleByLine = $articleByLine;
$this->articleByline = $articleByline;

return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Readability.php
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ private function textSimilarity(string $textA, string $textB): float
*/
private function checkByline(DOMNode|DOMText|DOMElement $node, string $matchString): bool
{
if (!$this->configuration->getArticleByLine()) {
if (!$this->configuration->getArticleByline()) {
return false;
}

Expand All @@ -987,7 +987,7 @@ private function checkByline(DOMNode|DOMText|DOMElement $node, string $matchStri
}

/**
* Checks the validity of a byLine. Based on string length.
* Checks the validity of a byline. Based on string length.
*/
private function isValidByline(string $text): bool
{
Expand Down
2 changes: 1 addition & 1 deletion test/test-pages/001/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ArticleByLine": true
"ArticleByline": true
}
2 changes: 1 addition & 1 deletion test/test-pages/aclu/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ArticleByLine": true
"ArticleByline": true
}
2 changes: 1 addition & 1 deletion test/test-pages/ars-1/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ArticleByLine": true
"ArticleByline": true
}
2 changes: 1 addition & 1 deletion test/test-pages/breitbart/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ArticleByLine": true
"ArticleByline": true
}
2 changes: 1 addition & 1 deletion test/test-pages/fortressofsolitude/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ArticleByLine": true
"ArticleByline": true
}
2 changes: 1 addition & 1 deletion test/test-pages/lwn-1/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ArticleByLine": true
"ArticleByline": true
}
2 changes: 1 addition & 1 deletion test/test-pages/marketwatch/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"ArticleByLine": true,
"ArticleByline": true,
"SubstituteEntities": true
}

0 comments on commit e03143c

Please sign in to comment.