string-interpreter 0.4.0.0 → 0.5.0.0
raw patch · 3 files changed
+31/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Interpreter.StringConversion: argsConvertTextual :: String -> [String] -> [String]
+ Interpreter.StringConversion: fullArgsConvertTextual :: String -> String -> [String] -> [String]
+ Interpreter.StringConversion: mightBePLWord :: String -> Bool
Files
- ChangeLog.md +5/−1
- Interpreter/StringConversion.hs +23/−1
- string-interpreter.cabal +3/−3
ChangeLog.md view
@@ -10,10 +10,14 @@ ## 0.3.0.0 -- 2021-08-31 -* Third version. Added the possibility to specify dividing using negative second +* Third version. Added the possibility to specify dividing using negative second part that is counting from the end of the word in the opposite direction. ## 0.4.0.0 -- 2021-09-03 * Fourth version. Added a new function readFileIfAny that catches all IOException's so that returns empty String. Some documentation improvements.++## 0.5.0.0 -- 2021-09-04++* Fifth version. Added new functions that can be used in the phonetic languages approach.
Interpreter/StringConversion.hs view
@@ -14,7 +14,7 @@ import Text.Read (readMaybe) import Data.Maybe (fromJust,fromMaybe)-import Data.Char (isDigit)+import Data.Char (isDigit,isAlpha) import Data.List (sort,nub,(\\)) import Data.Monoid (mappend) import Control.Exception@@ -59,3 +59,25 @@ some 'IOException' thrown or an empty file then returns just "". Raises an exception for the binary file. -} readFileIfAny :: FilePath -> IO String readFileIfAny file = catch (readFile file) (\(e :: IOException) -> return "")++-------------------------------------------------------------++{-| If 'True' then it might be the one word in the phonetic languages approach. If 'False', it is usually not.+-}+mightBePLWord :: String -> Bool+mightBePLWord xs+ | null (dropWhile (not . isAlpha) us) = not (null ts)+ | otherwise = False+ where (ts,us) = span isAlpha xs+{-# INLINE mightBePLWord #-}++argsConvertTextual :: String -> [String] -> [String]+argsConvertTextual ts tss+ | any (== ts) tss = tss+ | otherwise = tss `mappend` [ts]+{-# INLINE argsConvertTextual #-}++fullArgsConvertTextual :: String -> String -> [String] -> [String]+fullArgsConvertTextual textProcessment0 lineA args =+ argsConvertTextual textProcessment0 (takeWhile (not . mightBePLWord) args `mappend` words lineA)+{-# INLINE fullArgsConvertTextual #-}
string-interpreter.cabal view
@@ -2,9 +2,9 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: string-interpreter-version: 0.4.0.0-synopsis: Is used in the recursive mode for phonetic languages approach.-description: A library that has commonly used function for the phonetic-languages implementations.+version: 0.5.0.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 license: MIT license-file: LICENSE