FeatureMetadata.get_features¶
- FeatureMetadata.get_features(valid_raw_types: list = None, valid_special_types: list = None, invalid_raw_types: list = None, invalid_special_types: list = None, required_special_types: list = None, required_raw_special_pairs: List[Tuple[str, List[str] | Set[str]]] = None, required_exact=False, required_at_least_one_special=False) List[str] [source]¶
Returns a list of features held within the feature metadata object after being pruned through the available parameters.
- Parameters:
valid_raw_types (list, default None) – If a feature’s raw type is not in this list, it is pruned. If None, then no features are pruned through this logic.
valid_special_types (list, default None) – If a feature has a special type not in this list, it is pruned. Features without special types are never pruned through this logic. If None, then no features are pruned through this logic.
invalid_raw_types (list, default None) – If a feature’s raw type is in this list, it is pruned. If None, then no features are pruned through this logic.
invalid_special_types (list, default None) – If a feature has a special type in this list, it is pruned. Features without special types are never pruned through this logic. If None, then no features are pruned through this logic.
required_special_types (list, default None) – If a feature does not have all of the special types in this list, it is pruned. Features without special types are pruned through this logic. If None, then no features are pruned through this logic.
required_raw_special_pairs (List[Tuple[str, List[str]]], default None) – If a feature does not satisfy the (raw_type, special_types) requirement of at least one of the elements in this list, it is pruned. Identical to getting the union of calling get_features(valid_raw_types=[raw_type], required_special_types=special_types) for every element of (raw_type, special_types) in required_raw_special_pairs If raw_type is None, then any feature will satisfy the raw type requirement. If special_types is None, then any feature will satisfy the special type requirement (including those with no special types).
required_exact (bool, default False) – If True, then if a feature does not have the exact same special types (with no extra special types) as required_special_types, it is pruned. This is also applied to required_raw_special_pairs if specified. Has no effect if required_special_types and required_raw_special_pairs are None.
required_at_least_one_special (bool, default False) – If True, then if a feature has zero special types, it is pruned.
- Returns:
features
- Return type:
list of feature names in feature metadata that satisfy all checks dictated by the parameters.