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