phladiprelio-general-simple 0.12.1.0 → 0.12.2.0
raw patch · 3 files changed
+20/−9 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Phladiprelio.General.Simple: argsProcessing :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> ([[[PRS]]] -> [[Double]]) -> [[String]] -> [[String]] -> String -> IO (Int, [Double], Bool, FilePath, String, String, String, Int, Bool, Int8, FilePath, Int, Bool, String, [String])
+ Phladiprelio.General.Simple: argsProcessing :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> ([[[PRS]]] -> [[Double]]) -> [[String]] -> [[String]] -> String -> IO (Int, Int, [Double], Bool, FilePath, String, String, String, Int, Bool, Int8, FilePath, Int, Bool, String, [String])
- Phladiprelio.General.Simple: generalF :: Int -> [Double] -> Bool -> FilePath -> String -> (String -> String) -> (String, String) -> Int -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> ([[[PRS]]] -> [[Double]]) -> Int -> HashCorrections -> (Int8, [Int8]) -> Bool -> Int -> Bool -> Int8 -> (FilePath, Int) -> Bool -> String -> [String] -> IO [String]
+ Phladiprelio.General.Simple: generalF :: Int -> Int -> [Double] -> Bool -> FilePath -> String -> (String -> String) -> (String, String) -> Int -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> ([[[PRS]]] -> [[Double]]) -> Int -> HashCorrections -> (Int8, [Int8]) -> Bool -> Int -> Bool -> Int8 -> (FilePath, Int) -> Bool -> String -> [String] -> IO [String]
Files
- CHANGELOG.md +6/−0
- Phladiprelio/General/Simple.hs +13/−8
- phladiprelio-general-simple.cabal +1/−1
CHANGELOG.md view
@@ -146,3 +146,9 @@ * Twelfth version revised A. Fixed issue with 'white-spaced' halflines in the output. Updated the dependency boundaries of halfsplit. +## 0.12.2.0 -- 2023-11-12++* Twelfth version revised B. Added possibility to specify for +l2 ... -l2 group of arguments+ additionally a power of 10 for the multiplier that affects the value and groupping. Use for this++q with Int number as the next command line argument in the range [2..6]. The default value is 4.+
Phladiprelio/General/Simple.hs view
@@ -4,7 +4,7 @@ import GHC.Base import GHC.Enum (fromEnum,toEnum)-import GHC.Real (fromIntegral,(/),quot,rem,quotRem,round,gcd)+import GHC.Real (fromIntegral,(/),quot,rem,quotRem,round,gcd,(^)) import Text.Show (Show(..)) import Phladiprelio.General.PrepareText import Phladiprelio.General.Syllables @@ -39,7 +39,8 @@ import Phladiprelio.UniquenessPeriodsG generalF - :: Int -- ^ A 'length' of the next argument here.+ :: Int -- ^ A power of 10. 10 in this power is then multiplied the value of distance if the next ['Double'] argument is not empty. The default one is 4. The proper values are in the range [2..6].+ -> Int -- ^ A 'length' of the next argument here. -> [Double] -- ^ A list of non-negative values normed by 1.0 (the greatest of which is 1.0) that the line options are compared with. If null, then the program works as for version 0.12.1.0 without this newly-introduced argument since the version 0.13.0.0. The length of it must be a least common multiplier of the (number of syllables plus number of \'_digits\' groups) to work correctly. Is not used when the next 'FilePath' and 'String' arguments are not null. -> Bool -- ^ If 'True' then adds \"<br>\" to line endings for double column output -> FilePath -- ^ A path to the file to save double columns output to. If empty then just prints to 'stdout'.@@ -66,14 +67,14 @@ -> String -- ^ An initial string to be analyzed. -> [String] -> IO [String] -generalF ldc compards html dcfile selStr selFun (prestr,poststr) lineNmb wrs ks arr gs us vs h numTest hc (grps,mxms) descending hashStep emptyline splitting (fs, code) concurrently initstr universalSet +generalF power10 ldc compards html dcfile selStr selFun (prestr,poststr) lineNmb wrs ks arr gs us vs h numTest hc (grps,mxms) descending hashStep emptyline splitting (fs, code) concurrently initstr universalSet | null universalSet = let strOutput = ["You have specified the data and constraints on it that lead to no further possible options.", "Please, specify another data and constraints."] in mapM putStrLn strOutput >> return strOutput | length universalSet == 1 = mapM putStrLn universalSet >> return universalSet | otherwise = do let syllN = countSyll wrs arr us vs initstr -- universalSet = map unwords . permutations $ rss f ldc compards grps mxms - | null selStr = (if null compards then (sum . countHashes2G hashStep hc grps mxms) else (round . (*10000) . distanceSqrG2 ldc compards)) . readBasic3 (h . createSyllablesPL wrs ks arr gs us vs) (mconcat)+ | null selStr = (if null compards then (sum . countHashes2G hashStep hc grps mxms) else (round . (*10^power10) . distanceSqrG2 ldc compards)) . readBasic3 (h . createSyllablesPL wrs ks arr gs us vs) (mconcat) | otherwise = fromIntegral . diverse2GGL (selectSounds selFun selStr) (us `mappend` vs) . concatMap string1 . stringToXG wrs . filter (\c -> not (isDigit c) && c /= '_') hSetNewlineMode stdout universalNewlineMode if numTest >= 0 && numTest <= 179 && numTest /= 1 && null compards then do@@ -186,7 +187,7 @@ -> [[String]] -> [[String]] -> String - -> IO (Int, [Double], Bool, FilePath, String, String, String, Int, Bool, Int8, FilePath, Int, Bool, String, [String]) -- ^ These ones are intended to be used inside 'generalF'.+ -> IO (Int, Int, [Double], Bool, FilePath, String, String, String, Int, Bool, Int8, FilePath, Int, Bool, String, [String]) -- ^ These ones are intended to be used inside 'generalF'. argsProcessing wrs ks arr gs us vs h ysss zsss xs = do args0 <- getArgs let (argsC, args) = takeCs1R ('+','-') cSpecs args0@@ -203,6 +204,10 @@ | otherwise = (head dcspecs == "1",last dcspecs) selStr = concat . getB "+ul" $ argsB filedata = getB "+f" argsB+ power10' = fromMaybe 4 (readMaybe (concat . getB "+q" $ argsB)::Maybe Int)+ power10 + | power10' < 2 && power10' > 6 = 4+ | otherwise = power10' multiline2 = getB "+m" argsB (fileread,lineNmb) | null multiline2 = ("",-1)@@ -250,7 +255,7 @@ max2 = maximum basecomp compards = concatMap (replicate mulp . (/ max2)) basecomp variants1 = uniquenessVariants2GNBL ' ' id id id perms ll- return (ldc, compards, html, dcfile, selStr, prestr, poststr, lineNmb, emptyline, splitting, filesave, codesave, concurrently, basiclineoption, variants1)+ return (power10, ldc, compards, html, dcfile, selStr, prestr, poststr, lineNmb, emptyline, splitting, filesave, codesave, concurrently, basiclineoption, variants1) processingF :: (String -> String) -- ^ A function that specifies what 'Char's in the list the first argument makes to be the function sensitive to. Analogue of the @g@ function in the definition: https://hackage.haskell.org/package/phonetic-languages-simplified-examples-array-0.21.0.0/docs/src/Phonetic.Languages.Simplified.Array.Ukrainian.FuncRep2RelatedG2.html#parsey0Choice. Use just small 'Char' if they are letters, do not use \'.\' and spaces.@@ -270,7 +275,7 @@ -> Int -- ^ The hashing function step. The default value is 20. Is expected to be greater than 2, and better greater than 12. -> String -> IO ()-processingF selFun wrs ks arr gs us vs h numTest hc (grps,mxms) ysss zsss descending hashStep xs = argsProcessing wrs ks arr gs us vs h ysss zsss xs >>= \(ldc, compards, html, dcfile, selStr, prestr, poststr, lineNmb, emptyline, splitting, filesave, codesave, concurrently, basiclineoption, variants1) -> generalF ldc compards html dcfile selStr selFun (prestr,poststr) lineNmb wrs ks arr gs us vs h numTest hc (grps,mxms) descending hashStep emptyline splitting (filesave, codesave) concurrently basiclineoption variants1 >> return ()+processingF selFun wrs ks arr gs us vs h numTest hc (grps,mxms) ysss zsss descending hashStep xs = argsProcessing wrs ks arr gs us vs h ysss zsss xs >>= \(power10, ldc, compards, html, dcfile, selStr, prestr, poststr, lineNmb, emptyline, splitting, filesave, codesave, concurrently, basiclineoption, variants1) -> generalF power10 ldc compards html dcfile selStr selFun (prestr,poststr) lineNmb wrs ks arr gs us vs h numTest hc (grps,mxms) descending hashStep emptyline splitting (filesave, codesave) concurrently basiclineoption variants1 >> return () {-# INLINE processingF #-} -- | Specifies the group of the command line arguments for 'processingF', which specifies the@@ -280,7 +285,7 @@ cSpecs = zip ["+a","+b","+l2"] . cycle $ [-1] bSpecs :: CLSpecifications-bSpecs = [("+f",2),("+m",2),("+ul",1),("+w",1),("+dc",2)]+bSpecs = [("+f",2),("+m",2),("+ul",1),("+w",1),("+dc",2),("+q",1)] {-| 'selectSounds' converts the argument after \"+ul\" command line argument into a list of sound representations that is used for evaluation of \'uniqueness periods\' properties of the line. Is a modified Phonetic.Languages.Simplified.Array.General.FuncRep2RelatedG2.parsey0Choice from the @phonetic-languages-simplified-generalized-examples-array-0.19.0.1@ package. -}
phladiprelio-general-simple.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: phladiprelio-general-simple-version: 0.12.1.0+version: 0.12.2.0 -- A short (one-line) description of the package. synopsis: A generalized functionality of PhLADiPreLiO for different languages that uses hash algorithms.