Skip to content

Commit b4f1db6

Browse files
authored
Update CONTRIBUTING.md
1 parent d6ab37a commit b4f1db6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ python -m unittest discover -v
1515

1616
5. Submit a PR
1717

18+
### Tips: Implmementing a new scorer
19+
20+
All scorers follow a very similar implementation pattern:
21+
_The following use [ARI](https://github.com/cdimascio/py-readability-metrics/blob/master/readability/scorers/ari.py) as an example_
22+
- each scorer lives in the [scorers](https://github.com/cdimascio/py-readability-metrics/blob/master/readability/scorers) directory
23+
- each scorer has a [constructor](https://github.com/cdimascio/py-readability-metrics/blob/master/readability/scorers/ari.py#L17) that takes `statistics` and is registered [here](https://github.com/cdimascio/py-readability-metrics/blob/master/readability/readability.py#L11).
24+
- each scorer implements a method `score` and returns a `Result`. See [ARI](https://github.com/cdimascio/py-readability-metrics/blob/master/readability/scorers/ari.py#L16) for an example
25+
- each scorer provides a test(s) in [test/test_readability](https://github.com/cdimascio/py-readability-metrics/blob/master/test/test_readability.py#L13)
26+
1827
### Docs
1928

2029
1. Fork the repo

0 commit comments

Comments
 (0)