PhilipEHausner / python_heideltime

A Python wrapper for the temporal tagger HeidelTime.
GNU General Public License v3.0
11 stars 1 forks source link

Adding type hints and improving docs #2

Closed dennlinger closed 2 years ago

dennlinger commented 2 years ago

Added type hints to move descriptive comments into actual tangible programming feedback; e.g., it was unclear what type the "document time" should be in. Clarifying that it is a string already helps enormously.
Also added in comments that should show up during function previews to help clarify what parameters are possible, or what the specific format should be.
For some parameters, also added direct feedback from Python that raise Errors when inputting incorrect values (if available choices exist in the original Heideltime docs), or help with upper/lowercasing.

I haven't verified whether the hints actually show up (yet), but am planning on at least extending it to a usable state. @PhilipEHausner: Let me know if you want a more "thorough" PR, happy to add stuff before merging.

dennlinger commented 2 years ago

Addressed all comments, let me know if you have any further ideas. As for the explanation in the FIXME, feel free to add further comments if it is still unclear.