From 25c120d01c8d133ad8b481941de2ebbadf373f4e Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Thu, 2 Nov 2017 13:46:31 +0100 Subject: Show feature category Just the feature name is not enough information in some cases. --- src/Db.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Db.hs') diff --git a/src/Db.hs b/src/Db.hs index fa38db3..caeaf77 100644 --- a/src/Db.hs +++ b/src/Db.hs @@ -96,6 +96,13 @@ getFeaturesByBase db base = M.filterWithKey (\k v -> (base ++ ".") `isPrefixOf` -- |Get number of algorithms in database algorithmCount db = M.size $ dalgos db +split :: (Eq a) => a -> [a] -> [[a]] +split delim s = let (a, b:bs) = span (/= delim) s in a:split delim bs + +-- |Get base of feature +getFeatureBase :: String -> String +getFeatureBase feature = head $ split '.' feature + minMaxPublicationYears db = (firstyear, lastyear) where pubyears = catMaybes $ map (lookup "year" . E.fields) $ dpublications db -- cgit v1.2.3