spaCy/spacy/tests/regression
adrianeboyd adc9745718 Modify morphology to support arbitrary features (#4932)
* Restructure tag maps for MorphAnalysis changes

Prepare tag maps for upcoming MorphAnalysis changes that allow
arbritrary features.

* Use default tag map rather than duplicating for ca / uk / vi

* Import tag map into defaults for ga

* Modify tag maps so all morphological fields and features are strings
  * Move features from `"Other"` to the top level
  * Rewrite tuples as strings separated by `","`

* Rewrite morph symbols for fr lemmatizer as strings

* Export MorphAnalysis under spacy.tokens

* Modify morphology to support arbitrary features

Modify `Morphology` and `MorphAnalysis` so that arbitrary features are
supported.

* Modify `MorphAnalysisC` so that it can support arbitrary features and
multiple values per field. `MorphAnalysisC` is redesigned to contain:
  * key: hash of UD FEATS string of morphological features
  * array of `MorphFeatureC` structs that each contain a hash of `Field`
and `Field=Value` for a given morphological feature, which makes it
possible to:
    * find features by field
    * represent multiple values for a given field

* `get_field()` is renamed to `get_by_field()` and is no longer `nogil`.
Instead a new helper function `get_n_by_field()` is `nogil` and returns
`n` features by field.

* `MorphAnalysis.get()` returns all possible values for a field as a
list of individual features such as `["Tense=Pres", "Tense=Past"]`.

* `MorphAnalysis`'s `str()` and `repr()` are the UD FEATS string.

* `Morphology.feats_to_dict()` converts a UD FEATS string to a dict
where:
  * Each field has one entry in the dict
  * Multiple values remain separated by a separator in the value string

* `Token.morph_` returns the UD FEATS string and you can set
`Token.morph_` with a UD FEATS string or with a tag map dict.

* Modify get_by_field to use np.ndarray

Modify `get_by_field()` to use np.ndarray. Remove `max_results` from
`get_n_by_field()` and always iterate over all the fields.

* Rewrite without MorphFeatureC

* Add shortcut for existing feats strings as keys

Add shortcut for existing feats strings as keys in `Morphology.add()`.

* Check for '_' as empty analysis when adding morphs

* Extend helper converters in Morphology

Add and extend helper converters that convert and normalize between:

* UD FEATS strings (`"Case=dat,gen|Number=sing"`)
* per-field dict of feats (`{"Case": "dat,gen", "Number": "sing"}`)
* list of individual features (`["Case=dat", "Case=gen",
"Number=sing"]`)

All converters sort fields and values where applicable.
2020-01-23 22:01:54 +01:00
..
__init__.py Revert #4334 2019-09-29 17:32:12 +02:00
test_issue1-1000.py Modify morphology to support arbitrary features (#4932) 2020-01-23 22:01:54 +01:00
test_issue1001-1500.py Modify morphology to support arbitrary features (#4932) 2020-01-23 22:01:54 +01:00
test_issue1501-2000.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue2001-2500.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue2501-3000.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3001-3500.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3521.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3526.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3531.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3540.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3549.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3555.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3611.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3625.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3803.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3830.py Revert #4334 2019-09-29 17:32:12 +02:00
test_issue3839.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3869.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3879.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3880.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3882.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3951.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3959.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3962.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue3972.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4002.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4030.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4042.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4054.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4120.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4133.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4190.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4267.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4272.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4278.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4313.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4348.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4367.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4373.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4402.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4528.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4529.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4590.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4651.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4674.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
test_issue4707.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00