Open dhdaines opened 1 month ago
fixes #158
I got carried away and added types nearly everywhere.
For CompleteSet there is an issue since its API is quite strange (though I understand the intent)
For Vector this can't be done efficiently because it relies on mixing str
and float
everywhere including in the values, so numeric calculations are simply undefined for string vectors (otherwise we'd have to cal isinstance
repeatedly, which is super slow)
Final comment: any good reason why boost
needs to be an int
? It's a number
in lunr.js and it just gets multiplied into a float
anyway at some point.
Some of the code (pipeline.py) had some types. But this wasn't super useful because the magical
py.typed
file was not included in the package.So this adds that, but also adds some types.
I can't totally figure out how to use
Protocol
correctly for pipeline functions but in actual fact they have a fixed signature, and the attributes we add are purely for internal use, so it'stype: ignore
for the time being.