packages feed

mmsyn4 0.3.1.1 → 0.4.0.0

raw patch · 5 files changed

+43/−15 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- MMSyn4: process2 :: String -> String -> String -> IO ()
+ MMSyn4: process2 :: String -> String -> String -> String -> String -> String -> IO ()

Files

ChangeLog.md view
@@ -56,3 +56,9 @@ ## 0.3.1.1 -- 2020-05-16  * Third version revised B. Trying the same as above with more specific syntaxis and LANGUAGE CPP pragma.++## 0.4.0.0 -- 2020-05-19++* Fourth version. Added the new command line arguments "-y", "-s...", "-b..." to specify whether to remove the '@' markers, which option is used to splines +GraphViz functionality and what is the basic name for the created files respectively. For this changed the functions. Some documentation additions +respectively.
MMSyn4.hs view
@@ -117,27 +117,25 @@     mconcat . V.toList $ v, "}", endOfLineGv]  -- | Processes the given text (the first 'String' argument). The second one is used to get a name of the command to be --- executed to obtain a visualization file. The third argument is used for the 'getFormat'. -process2 :: String -> String -> String -> IO ()-process2 text xxs yys +-- executed to obtain a visualization file. The third argument is used for the 'getFormat'. The fourth argument is the +-- basic name for the created files (without prefixes and extensions), the fifth one is an option for GraphVize splines +-- functionality. The sixth argument is used to specify whether to remove at-signs from the created files.+process2 :: String -> String -> String -> String -> String -> String -> IO ()+process2 text xxs yys bnames splines remAts   | length text > 0 = do       ts <- getCPUTime-      [zs,x2,remAt] <- processCtrl-      let xs = take 1 x2-      if take 1 remAt == "y"+      [bnames,splines] <- proc2Params2 bnames splines+      if remAts == "y"         then do -          let ys = filter (/='@') . processCellsG xs $ text in writeFile (show ts ++ "." ++ zs ++ ".gv") ys+          let ys = filter (/='@') . processCellsG splines $ text in writeFile (show ts ++ "." ++ bnames ++ ".gv") ys           putStrLn "The visualization will be created without the at-sign."-          processFile 'n' ts zs xxs yys+          processFile 'n' ts bnames xxs yys         else do -          let ys = processCellsG xs text in writeFile ("at." ++ show ts ++ "." ++ zs ++ ".gv") ys+          let ys = processCellsG splines text in writeFile ("at." ++ show ts ++ "." ++ bnames ++ ".gv") ys           putStrLn "The visualization will be created with the at-sign preserved."-          processFile 'a' ts zs xxs yys+          processFile 'a' ts bnames xxs yys   | otherwise = error "Empty text to be processed! " -processCtrl :: IO [String]-processCtrl = mapM procCtrl [1..3]- procCtrl :: Int -> IO String procCtrl 1 = putStrLn "Please, input the basic name of the visualization file!" >> getLine procCtrl 2 = do @@ -180,6 +178,12 @@   mapM_ printFormF ["do", "xd", "ps", "pd", "sv", "sz", "fi", "pn", "gi", "jp", "je", "js", "im", "cm"]   putStrLn "otherwise there will be used the default -Tsvg"   getLine++proc2Params2 :: String -> String -> IO [String]+proc2Params2 bnames splines + | null bnames = if null splines then mapM procCtrl [1,2] else do { bnames <- procCtrl 1 ; return [bnames,splines] }+ | null splines = do { splines <- procCtrl 2 ; return [bnames,splines] }+ | otherwise = return [bnames,splines]  getFormat1 :: Int -> IO String getFormat1 1 = do 
Main.hs view
@@ -61,9 +61,12 @@       arggs = drop 1 args       xxs = concatMap (take 1 . drop 2) . filter ("-c" `isPrefixOf`) $ arggs       yys = concatMap (take 2 . drop 2) . filter ("-f" `isPrefixOf`) $ arggs+      bnames = concatMap (drop 2) . filter ("-b" `isPrefixOf`) $ arggs+      splines = concatMap (take 1 . drop 2) . filter ("-s" `isPrefixOf`) $ arggs+      remAts = concatMap (take 1 . drop 1) . filter ("-y" `isPrefixOf`) $ arggs   exI <- doesFileExist arg0   if exI      then do        text2 <- readFile arg0-      process2 text2 xxs yys+      process2 text2 xxs yys bnames splines remAts     else putStrLn "No file specified exists in the current directory! "  
README.markdown view
@@ -1,3 +1,4 @@+                           ***** Usage *****              ----------------- @@ -79,6 +80,20 @@  -f... -- dots are instead of two letters to specify the format (according to    the 'getFormat') of the GraphViz command (e. g. \'jp\' -- for \'jpg\')++Since the version 0.4.0.0 mmsyn4 supports the following further +command line arguments (additionally to the previous ones):++-b... -- dots are instead of the basic name for the created files (the +name without prefixes and extensions)++-s... -- dots are instead of one digit to specify the GraphViz splines +functionality. 0 -- for "splines=false"; 1 -- for "splines=true"; +2 -- for "splines=ortho"; 3 -- for "splines=polyline". The default +one is "splines=true".++-y -- (if present) means that the '@' signs will be removed from the created +files.  They can be given in any combinations (if needed) or omitted. In the latter  one case the program will prompt you the needed information (but this is 
mmsyn4.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                mmsyn4-version:             0.3.1.1+version:             0.4.0.0 synopsis:            The "glue" between electronic tables and GraphViz description:         The program mmsyn4 converts a specially formated .csv file with a colon as a field separator obtained from the electronic table into a visualized by GraphViz graph. homepage:            https://hackage.haskell.org/package/mmsyn4