Closed DavidHowlett closed 2 years ago
In the Paradigm class, "self._stems_to_forms" is always defined, so stems_to_forms should have the type "pynini.Fst" not "Optional[pynini.Fst]". This can be seen at https://github.com/kylebgorman/pynini/blob/master/pynini/lib/paradigms.py#L525
This then means that another function can be changed to also return pynini.Fst rather than Optional[pynini.Fst]. This is visible at https://github.com/kylebgorman/pynini/blob/master/pynini/lib/paradigms.py#L382
It is not super important but if this is fixed I can remove a couple of "# type: ignore" from the code I am working on.
I see, you're right. That member is defined in the __init__. Will fix in next release. (Which actually should happen in January or so.)
__init__
Thanks Kyle
In the Paradigm class, "self._stems_to_forms" is always defined, so stems_to_forms should have the type "pynini.Fst" not "Optional[pynini.Fst]". This can be seen at https://github.com/kylebgorman/pynini/blob/master/pynini/lib/paradigms.py#L525
This then means that another function can be changed to also return pynini.Fst rather than Optional[pynini.Fst]. This is visible at https://github.com/kylebgorman/pynini/blob/master/pynini/lib/paradigms.py#L382
It is not super important but if this is fixed I can remove a couple of "# type: ignore" from the code I am working on.