@@ -47,7 +47,7 @@ getExprs opts env string = map getExpr sentences
4747 devtree1 = analyseWords env devtree0
4848 devtree = combineTrees env devtree1
4949 besttree0 = head (splitDevTree devtree)
50- besttree = addBackups besttree0
50+ besttree = addBackups opts besttree0
5151 ts0 = devtree2abstrees besttree
5252 ts1 = map (expandMacro env) ts0
5353 crs = map (checkAbsTreeResult env) ts1
@@ -84,7 +84,7 @@ showUD2GF opts env sentence = do
8484 let besttree0 = head (splitDevTree devtree)
8585 ifOpt opts " bt0" $ prLinesRTree (prDevNode 1 ) besttree0
8686
87- let besttree = addBackups besttree0
87+ let besttree = addBackups opts besttree0
8888 ifOpt opts " bt" $ prLinesRTree (prDevNode 1 ) besttree
8989
9090 let ts0 = devtree2abstrees besttree
@@ -230,15 +230,16 @@ devtree2abstrees :: DevTree -> [AbsTree]
230230devtree2abstrees = map atiAbsTree . devAbsTrees . root
231231
232232-- to be applied to a DevTree with just one tree at each node
233- addBackups :: DevTree -> DevTree
234- addBackups = addBackups0 ---- TODO: this must be improved
233+ addBackups :: Opts -> DevTree -> DevTree
234+ addBackups opts | isOpt opts " no-backups" = id
235+ | otherwise = addBackups0 ---- TODO: this must be improved
235236
236237addBackups0 :: DevTree -> DevTree
237238addBackups0 tr@ (RTree dn trs) = case map collectBackup (tr: trs) of -- backups from the tree itself and every subtree
238239 btrs -> RTree
239240 (dn {devAbsTrees = [
240- replaceInfo [(t,ai) | (_,(t,Just ai)) <- btrs] --
241- (theAbsTreeInfo tr)] -- the only abstree that there is
241+ replaceInfo [(t,ai) | (_,(t,Just ai)) <- btrs] --
242+ (theAbsTreeInfo tr)] -- the only abstree that there is
242243 }
243244 )
244245 (map fst (tail btrs))
@@ -355,7 +356,7 @@ combineTrees env =
355356 where
356357 -- The head only contains new trees that were created in the previous iteration
357358 onlyNewTree = tr {root = nd { devAbsTrees = map funInfoToAbsTreeInfo fis}}
358- -- Add the new trees to the old ones. There shouldn't really be any duplicates now, so there's
359+ -- Add the new trees to the old ones. There shouldn't really be any duplicates now, so there's
359360 -- a bit of redundant checking going on here.
360361 nextTr = combineUnduplicated fis tr
361362
@@ -479,7 +480,7 @@ analyseWords env = mapRTree lemma2fun
479480
480481 auxWords = [(lemma,cat) | ((fun_,lemma),(cat,labels_)) <- M. assocs (lemmaLabels (cncLabels env))]
481482
482- -- auxiliaries
483+ -- auxiliaries
483484newWordTree w c = RTree (mkCId (w ++ " _" ++ showCId c)) [] ---
484485isNewWordFun f = isInfixOf " __x__" (showCId f)
485486unknownCat = mkCId " Adv" --- treat unknown words as adverbs ---- TODO: from config
0 commit comments