1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

Featurize without getField.

This commit is contained in:
Rob Rix 2017-10-24 00:03:20 -04:00
parent b2ef834746
commit fc65ef95b2

View File

@ -140,7 +140,7 @@ mapContiguous canCompare = go [] []
featurize :: Functor syntax => Int -> Term syntax (Record (FeatureVector ': fields)) -> UnmappedTerm syntax (Record (FeatureVector ': fields))
featurize index term = UnmappedTerm index (getField (extract term)) (eraseFeatureVector term)
featurize index term = UnmappedTerm index (rhead (extract term)) (eraseFeatureVector term)
eraseFeatureVector :: Functor syntax => Term syntax (Record (FeatureVector ': fields)) -> Term syntax (Record (FeatureVector ': fields))
eraseFeatureVector (Term.Term (In record functor)) = termIn (setFeatureVector record nullFeatureVector) functor