mirror of
https://github.com/explosion/spaCy.git
synced 2025-11-02 17:07:49 +03:00
We want methods to act like they're "bound" to the object, so that you can make your method conditional on the `doc`, `span` or `token` instance --- like, well, a method. We therefore partially apply the function, which works like this:
```
def partial(unbound_method, constant_arg):
def bound_method(*args, **kwargs):
return unbound_method(constant_arg, *args, **kwargs)
return bound_method
|
||
|---|---|---|
| .. | ||
| __init__.pxd | ||
| __init__.py | ||
| binder.pyx | ||
| doc.pxd | ||
| doc.pyx | ||
| printers.py | ||
| span.pxd | ||
| span.pyx | ||
| token.pxd | ||
| token.pyx | ||
| underscore.py | ||