From 2c1868c09a771d6da5755c83530238ecb60a77d2 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Sun, 2 Dec 2018 11:25:56 +0100 Subject: [PATCH] levenstein segfault --- 2/s2.icl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/2/s2.icl b/2/s2.icl index fe363bf..72d2ba6 100644 --- a/2/s2.icl +++ b/2/s2.icl @@ -3,6 +3,7 @@ module s2 import StdEnv import Data.Func import Data.List +import Debug.Trace getinput :: [Char] *File -> [[Char]] getinput a f @@ -20,4 +21,6 @@ Start w $ getinput [] io proc [] = [] -proc [x:xs] = [[(e, x)\\e<-xs | length [()\\a<-x & b<-e | a<>b] <= 1]:proc xs] +proc [x:xs] = [[(e, x)\\e<-xs | levenshtein` x e <= 1]:proc xs] + +levenshtein` a b = levenshtein (trace_stdout a) (trace_stdout b) -- 2.20.1