nlpub / chinese-whispers

An implementation of Chinese Whispers in Python.
https://chinese-whispers.readthedocs.io
MIT License
58 stars 13 forks source link

allow configurable dict key for cluster label #26

Closed 3wille closed 3 years ago

3wille commented 3 years ago

adds function arguments that are used to access/set the dict key to save the cluster label

3wille commented 3 years ago

Hi, I need to configure the key for cluster labels and thought this might be interesting to the project as well. I looked for a way to configure this as a variable but my search didn't bring up any quick way.

dustalov commented 3 years ago

Hi, I think this would be useful. I will be happy to merge this PR after two adjustments:

  1. Please add the unit test for this functionality to test_chinese_whispers.py.
  2. Kindly make sure all the tests are passing by updating the type annotations in the source code.
3wille commented 3 years ago

For the tests I tried to stay close to the previous tests without changing them. If you had something different in mind, please let me know

dustalov commented 3 years ago

Thank you!