From a65a1ba67d1e8a7f91101da8d1c8ae4497089a60 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Mon, 23 Jan 2017 17:12:52 +1100 Subject: Potential preference data parsing bug with end of line characters fixed --- src/Counter.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Counter.hs b/src/Counter.hs index 317f96a..37b36dc 100644 --- a/src/Counter.hs +++ b/src/Counter.hs @@ -45,7 +45,7 @@ createSenateCounter f a b = do h <- IO.openFile f IO.ReadMode let readFunc n p = if (n > numLines) then return p else do t0 <- IO.hGetLine h - let t1 = CSV.parseRecord CSV.defaultSettings t0 + let t1 = CSV.parseRecord CSV.defaultSettings (t0 ++ "\n") t2 = Maybe.listToMaybe . reverse . Either.fromRight $ t1 t3 = Pref.parsePreferences (length a) (length b) (Maybe.fromJust t2) t4 = Pref.normalise a b (Either.fromRight t3) -- cgit