Documentation
¶
Overview ¶
Package extractor provides routines to extract token features for the solidify toolchain from a standard metadata JSON files or token feature maps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeFeatures ¶
func EncodeFeatures(fMaps []FeaturesMap, fTypes []types.FeatureGroup) ([][]uint8, error)
EncodeFeatures converts FeatureMaps into uint slices where each element corresponds to the index at which the respective feature (type and value) appears in the feature groups list.
func ExtractFeatureGroups ¶
func ExtractFeatureGroups(fMaps []FeaturesMap) []types.FeatureGroup
ExtractFeatureGroups retrieves groups of features (types with their different values) from a given set of FeaturesMaps.
Types ¶
type FeaturesMap ¶
A FeaturesMap maps feature types to values, defining a token. e.g. Background -> Black, Body -> Robot, etc.
func LoadAndParseFeatureJSON ¶
func LoadAndParseFeatureJSON(path string) ([]FeaturesMap, error)
LoadAndParseFeatureJSON loads the features from a JSON file at a given path and parses the content into a list of FeaturesMap.
func ParseFeaturesJSON ¶
func ParseFeaturesJSON(r io.Reader) ([]FeaturesMap, error)
ParseFeaturesJSON parses features from a JSON schema into a list of FeatureMaps. e.g. JSON = `[{"Body": "Robot"},{"Body": "Alien"}]`