kylebgorman / pynini

Read-only mirror of Pynini
http://pynini.opengrm.org
Apache License 2.0
118 stars 27 forks source link

Small type error #51

Closed DavidHowlett closed 2 years ago

DavidHowlett commented 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.

kylebgorman commented 2 years ago

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.)

DavidHowlett commented 2 years ago

Thanks Kyle