You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,15 @@ python -m unittest discover -v
15
15
16
16
5. Submit a PR
17
17
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)
0 commit comments