packages feed

string-interpreter 0.5.3.0 → 0.5.4.0

raw patch · 3 files changed

+13/−7 lines, 3 files

Files

ChangeLog.md view
@@ -32,5 +32,9 @@  ## 0.5.3.0 -- 2021-10-01 -* Fifth version revised C. Fixed issue with the negative second number in the -conversion function. +* Fifth version revised C. Fixed issue with the negative second number in the conversion function.++## 0.5.4.0 -- 2021-10-09++* Fifth version revised C. Changed the behaviour so that it can handle lines with more than 9 words.+
Interpreter/StringConversion.hs view
@@ -15,7 +15,7 @@ import Text.Read (readMaybe) import Data.Maybe (fromJust,fromMaybe) import Data.Char (isDigit)-import Data.List (sort,nub,(\\))+import Data.List (sort,(\\)) import Data.Monoid (mappend) import Control.Exception @@ -25,7 +25,7 @@  | null contrs = xs  | null . words $ xs = xs  | case filter (\y -> isDigit y || y == '/' || y == '-') contrs of { a:'/':bs -> a /= '/' && a /= '0' ; ~rrr -> False } =-     let ys = filter (\y -> isDigit y || y == '/' || y == '-') contrs in+     let ys = filter (\y -> isDigit y || y == '/') contrs in        case ys of          ~a:'/':bs -> let wordsN = words xs                           wordN = min (fromMaybe 1 (readMaybe [a]::Maybe Int)) (length wordsN)@@ -38,8 +38,8 @@                           kss = drop 1 tss in                             if null wss then twoWords `mappend` (' ':unwords kss)                             else unwords wss `mappend` (' ':twoWords) `mappend` (' ':unwords kss)- | length (nub . filter (\t -> t >= '1' && [t] <= show (length . words $ xs)) $ contrs) < 2 = xs- | otherwise = let cntrs = nub . filter (\t -> t >= '1' && [t] <= show (length . words $ xs)) $ contrs+ | length (filter (\t -> t >= '1' && [t] <= show (length . words $ xs)) $ contrs) < 2 = xs+ | otherwise = let cntrs = filter (\t -> if (length . words $ xs) >= 10 then t >= '1' && t <= '9' else t >= '1' && [t] <= show (length . words $ xs)) $ contrs                    tss = words xs in                      case length cntrs of                       2 -> let pos = fromJust (readMaybe (take 1 cntrs)::Maybe Int)@@ -77,6 +77,8 @@ fullArgsConvertTextual p textProcessment0 lineA args =   argsConvertTextual textProcessment0 (takeWhile p args `mappend` words lineA) {-# INLINE fullArgsConvertTextual #-}++-------------------------------------------------------------  fullArgsConvertTextualSimple   :: (String -> Bool) -- ^ The predicate that checks whether the given argument is not a phonetic language word in the representation.
string-interpreter.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                string-interpreter-version:             0.5.3.0+version:             0.5.4.0 synopsis:            Is used in the phonetic languages approach (e. g. in the recursive mode). description:         A library that has commonly used functions for the phonetic-languages implementations that deals with String data. homepage:            https://hackage.haskell.org/package/string-interpreter