Wrap filter type more
This commit is contained in:
parent
6f6c96969d
commit
015053ec87
@ -377,7 +377,7 @@ checkAndGetDataSources forceInput gevalSpec = do
|
||||
challengeDataSourceExpected = expectedSource,
|
||||
challengeDataSourceSelector = mSelector,
|
||||
challengeDataSourcePreprocess = preprocess,
|
||||
challengeDataSourceFilter = Filter Nothing,
|
||||
challengeDataSourceFilter = noFilter,
|
||||
challengeDataSourceInHeader = mInHeader,
|
||||
challengeDataSourceOutHeader = mOutHeader }
|
||||
|
||||
@ -502,7 +502,7 @@ gevalCoreOnSingleLines metric preprocess inpDecoder inpLine expDecoder expLine o
|
||||
then preprocess
|
||||
else id
|
||||
lsSpec = LineSourcesSpecification {
|
||||
lineSourcesFilter = Filter Nothing,
|
||||
lineSourcesFilter = noFilter,
|
||||
lineSourcesInputSource = singleLineAsLineSource inpLine inpDecoder preprocess,
|
||||
lineSourcesExpectedSource = singleLineAsLineSource expLine expDecoder outputPreprocess,
|
||||
lineSourcesOutputSource = singleLineAsLineSource outLine outDecoder outputPreprocess }
|
||||
|
@ -1,7 +1,9 @@
|
||||
module GEval.DataSource
|
||||
(ChallengeDataSource(..),
|
||||
DataSource(..),
|
||||
Filter(..))
|
||||
Filter,
|
||||
noFilter,
|
||||
applyFilter)
|
||||
where
|
||||
|
||||
import Data.Text
|
||||
@ -12,6 +14,13 @@ import GEval.Selector
|
||||
|
||||
newtype Filter = Filter (Maybe (Text -> Bool))
|
||||
|
||||
noFilter :: Filter
|
||||
noFilter = Filter Nothing
|
||||
|
||||
applyFilter :: Filter -> (Text, (Text, Text)) -> Bool
|
||||
applyFilter (Filter Nothing) _ = True
|
||||
applyFilter (Filter (Just fun)) (inp, (exp, out)) = fun inp
|
||||
|
||||
-- | This type specifies the way the challenge data (input and
|
||||
-- expected data, but not outputs) flow into evaluation.
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user