mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
Add missing default to .set_extension (#2297)
Failing to set a default, method, or getter results in a ValueError: ValueError: [E083] Error setting extension: only one of `default`, `method`, or `getter` (plus optional `setter`) is allowed. Got: 0
This commit is contained in:
parent
929a01139a
commit
9a1d3b63fb
|
@ -68,9 +68,9 @@ class RESTCountriesComponent(object):
|
|||
# the matches, so we're only setting a default value, not a getter.
|
||||
# If no default value is set, it defaults to None.
|
||||
Token.set_extension('is_country', default=False)
|
||||
Token.set_extension('country_capital')
|
||||
Token.set_extension('country_latlng')
|
||||
Token.set_extension('country_flag')
|
||||
Token.set_extension('country_capital', default=False)
|
||||
Token.set_extension('country_latlng', default=False)
|
||||
Token.set_extension('country_flag', default=False)
|
||||
|
||||
# Register attributes on Doc and Span via a getter that checks if one of
|
||||
# the contained tokens is set to is_country == True.
|
||||
|
|
Loading…
Reference in New Issue
Block a user