From 13f9629cbcb2e6356624e0abcce2ae0843e0ab1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Grali=C5=84ski?= Date: Thu, 10 Jan 2019 10:00:51 +0100 Subject: [PATCH] Minor refactor --- src/GEval/BLEU.hs | 5 ----- src/GEval/Common.hs | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/GEval/BLEU.hs b/src/GEval/BLEU.hs index b9afc1b..7458656 100644 --- a/src/GEval/BLEU.hs +++ b/src/GEval/BLEU.hs @@ -55,11 +55,6 @@ precisionCount refs = sum . map (lookFor refs) . MS.toOccurList . MS.fromList upToTetragrams :: [a] -> ([a], [(a, a)], [(a, a, a)], [(a, a, a, a)]) upToTetragrams l = (l, bigrams l, trigrams l, tetragrams l) -bigrams :: [a] -> [(a, a)] -bigrams [] = [] -bigrams [_] = [] -bigrams u = zip u $ tail u - trigrams :: [a] -> [(a, a, a)] trigrams [] = [] trigrams [_] = [] diff --git a/src/GEval/Common.hs b/src/GEval/Common.hs index 31fa578..8439408 100644 --- a/src/GEval/Common.hs +++ b/src/GEval/Common.hs @@ -53,3 +53,8 @@ whitespace = many1 (satisfy isHorizontalSpace) indicator :: Bool -> Double indicator True = 1.0 indicator False = 0.0 + +bigrams :: [a] -> [(a, a)] +bigrams [] = [] +bigrams [_] = [] +bigrams u = zip u $ tail u