spaCy/spacy/tests/regression
Matthew Honnibal 8aa7882762
Make NORM a token attribute (#3029)
See #3028. The solution in this patch is pretty debateable.

What we do is give the TokenC struct a .norm field, by repurposing the previously idle .sense attribute. It's nice to repurpose a previous field because it means the TokenC doesn't change size, so even if someone's using the internals very deeply, nothing will break.

The weird thing here is that the TokenC and the LexemeC both have an attribute named NORM. This arguably assists in backwards compatibility. On the other hand, maybe it's really bad! We're changing the semantics of the attribute subtly, so maybe it's better if someone calling lex.norm gets a breakage, and instead is told to write lex.default_norm?

Overall I believe this patch makes the NORM feature work the way we sort of expected it to work. Certainly it's much more like how the docs describe it, and more in line with how we've been directing people to use the norm attribute. We'll also be able to use token.norm to do stuff like spelling correction, which is pretty cool.
2018-12-08 10:49:10 +01:00
..
__init__.py Add __init__.py file for regression tests 2016-11-01 13:45:06 +01:00
_test_issue2800.py Tidy up and format remaining files 2018-11-30 17:43:08 +01:00
test_issue1-1000.py Tidy up and format remaining files 2018-11-30 17:43:08 +01:00
test_issue1001-1500.py 💫 Tidy up and auto-format tests (#2967) 2018-11-27 01:09:36 +01:00
test_issue1501-2000.py Tidy up and format remaining files 2018-11-30 17:43:08 +01:00
test_issue2001-2500.py Tidy up and format remaining files 2018-11-30 17:43:08 +01:00
test_issue2564.py 💫 Tidy up and auto-format tests (#2967) 2018-11-27 01:09:36 +01:00
test_issue2569.py 💫 Tidy up and auto-format tests (#2967) 2018-11-27 01:09:36 +01:00
test_issue2626.py Tidy up and format remaining files 2018-11-30 17:43:08 +01:00
test_issue2671.py Tidy up and format remaining files 2018-11-30 17:43:08 +01:00
test_issue2754.py Make NORM a token attribute (#3029) 2018-12-08 10:49:10 +01:00
test_issue2772.py 💫 Tidy up and auto-format tests (#2967) 2018-11-27 01:09:36 +01:00
test_issue2782.py 💫 Tidy up and auto-format tests (#2967) 2018-11-27 01:09:36 +01:00