phladiprelio-general-simple 0.3.0.0 → 0.4.0.0
raw patch · 4 files changed
+34/−19 lines, 4 filesdep ~phonetic-languages-constraints-arrayPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: phonetic-languages-constraints-array
API changes (from Hackage documentation)
- Phladiprelio.General.Simple: generalF :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> ([[[PRS]]] -> [[Double]]) -> Int -> HashCorrections -> (Int8, [Int8]) -> Bool -> Int -> [String] -> IO [()]
+ Phladiprelio.General.Simple: generalF :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> ([[[PRS]]] -> [[Double]]) -> Int -> HashCorrections -> (Int8, [Int8]) -> Bool -> Int -> Bool -> [String] -> IO [()]
Files
- CHANGELOG.md +8/−0
- Phladiprelio/General/Simple.hs +17/−7
- README.md +7/−10
- phladiprelio-general-simple.cabal +2/−2
CHANGELOG.md view
@@ -46,3 +46,11 @@ rules application) and "+a ... -a" (constraints). Updated documentation (especially new pdfs). Added new lightweight dependencies. +## 0.4.0.0 -- 2023-05-24++* Fourth version. Added two new command line groups of arguments - "+l" (add empty line to output for +not test option) and +b ... -b with the extended group of constraints handling. Extended the +set of constraints with new ones and now there are 12 types of them. Some documentation+improvements. Fixed issues with the numbering in the constraints. +Updated the documentation and dependencies boundaries. +
Phladiprelio/General/Simple.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE NoImplicitPrelude, BangPatterns #-} module Phladiprelio.General.Simple where @@ -41,9 +41,12 @@ -> (Int8,[Int8]) -> Bool -> Int -- ^ The hashing function step. The default value is 20. Is expected to be greater than 2, and better greater than 12. + -> Bool -> [String] -> IO [()] -generalF wrs ks arr gs us vs h numTest hc (grps,mxms) descending hashStep universalSet = do+generalF wrs ks arr gs us vs h numTest hc (grps,mxms) descending hashStep emptyline universalSet + | null universalSet = mapM putStrLn ["You have specified the data and constraints on it that lead to no further possible options.", "Please, specify another data and constraints."]+ | otherwise = do let syllN = countSyll wrs arr us vs . concat . take 1 $ universalSet -- universalSet = map unwords . permutations $ rss f grps mxms = sum . countHashes2G hashStep hc grps mxms . mconcat . h . createSyllablesPL wrs ks arr gs us vs@@ -51,7 +54,10 @@ hSetNewlineMode stdout universalNewlineMode putStrLn "Feet Val Stat Proxim" mapM (\(q,qs) -> let m = stat1 syllN (q,qs) in let max1 = maximumBy (comparing (f q qs)) universalSet in let mx = f q qs max1 in putStrLn (show (fromEnum q) `mappend` " | " `mappend` show mx `mappend` " " `mappend` show m `mappend` " -> " `mappend` show (100 * fromIntegral mx / fromIntegral m) `mappend` "%" `mappend` (if numTest >= 4 then let min1 = minimumBy (comparing (f q qs)) universalSet in ("\n" `mappend` min1 `mappend` "\n" `mappend` max1 `mappend` "\n") else ""))) . zip [2..7] $ (sel numTest)- else mapM (\(x,y) -> putStrLn (show x `mappend` (' ':y))) . (let h1 (u,w) = if descending then ((-1)*u,w) else (u,w) in sortOn h1) . map (\xss -> (f grps mxms xss, xss)) $ universalSet+ else (if emptyline + then mapM (\tss -> mapM (\(x, y) -> putStrLn (show x `mappend` (' ':y))) tss >> putStrLn "") . groupBy (\(x1,_) (x2,_) -> x1 == x2)+ else mapM (\(x,y) -> putStrLn (show x `mappend` (' ':y)))) + . (let h1 (u,w) = if descending then ((-1)*u,w) else (u,w) in sortOn h1) . map (\xss -> (f grps mxms xss, xss)) $ universalSet where sel x | x == 0 || x == 4 = [[1],[2,1],[3,2],[4,3,2],[5,4,3],[6,5,4,3,2]] | x == 2 || x == 5 = [[1],[2],[3],[4,3],[5,4],[6,5,4]]@@ -102,18 +108,22 @@ args0 <- getArgs let (argsC, args) = takeCs1R ('+','-') cSpecs args0 prepare = any (== "-p") args- argCs = catMaybes (fmap (readMaybeECG (l - 1)) -- . (showB l lstW2:)+ emptyline = any (== "+l") args + argCs = catMaybes (fmap (readMaybeECG l) -- . (showB l lstW2:) . getC "+a" $ argsC) ll = take 7 . (if prepare then id else words . mconcat . prepareText ysss zsss xs . unwords) $ args l = length ll- perms + argCBs = concat . getC "+b" $ argsC + !perms + | not (null argCBs) = filterGeneralConv l argCBs . genPermutationsL $ l | null argCs = genPermutationsL l | otherwise = decodeLConstraints argCs . genPermutationsL $ l variants1 = uniquenessVariants2GNBL ' ' id id id perms ll- generalF wrs ks arr gs us vs h numTest hc (grps,mxms) descending hashStep variants1 >> return ()+ generalF wrs ks arr gs us vs h numTest hc (grps,mxms) descending hashStep emptyline variants1 >> return () -- | Specifies the group of the command line arguments for 'processingF', which specifies the -- PhLADiPreLiO constraints. For more information, see: -- https://oleksandr-zhabenko.github.io/uk/rhythmicity/PhLADiPreLiO.Eng.21.html#constraints cSpecs :: CLSpecifications-cSpecs = [("+a",-1)]+cSpecs = zip ["+a","+b"] . cycle $ [-1]+
README.md view
@@ -1,6 +1,6 @@ The library is the new implementation of the ideas related to PhLADiPreLiO (Phonetic Languages Approach to Discovering the Preferred Line Options) for different languages. It uses hashes and-has at the moment (as of the version 0.3.0.0) not the full functionality. The previous implementation +has at the moment (as of the version 0.4.0.0) not the full functionality. The previous implementation and its documentation are at the links: https://hackage.haskell.org/package/phonetic-languages-simplified-generalized-examples-array@@ -10,19 +10,16 @@ [English documentation](https://oleksandrzhabenko.github.io/uk/rhythmicity/PhLADiPreLiO.Eng.21.pdf) The documentation for the new implementation is available at the following links.-[Новий текст теорії](https://oleksandr-zhabenko.github.io/uk/rhythmicity/phladiprelioUkr.new.4.pdf)--[New implementation](https://oleksandr-zhabenko.github.io/uk/rhythmicity/phladiprelioEng.new.4.pdf)+[Новий текст теорії](https://oleksandr-zhabenko.github.io/uk/rhythmicity/phladiprelioUkr.5.pdf) -Example of the new functionality in the version 0.3.0.0 of the related prototype project for -Ukrainian is in the video:+[New implementation](https://oleksandr-zhabenko.github.io/uk/rhythmicity/phladiprelioEng.5.pdf) -https://www.facebook.com/Oleksandr.S.Zhabenko/posts/pfbid0QT1BCWf9fmgQHasfUrSSqCenR9YT1C6CtL8PV4ieGrCTWGwatRh6TTUcxho8irkHl+Examples of the new functionality in the version 0.5.0.0 of the related prototype project for +Ukrainian is in the videos: -Example of the new functionality in the version 0.3.3.0 of the related prototype project for-Ukrainian is in the video:+https://www.facebook.com/Oleksandr.S.Zhabenko/posts/pfbid033gzq8MCRQsm65mPrzJL25MZNgvW7mezQSywULiVMnqmTBMtSW2jW4ABh6HVMWZNLl -https://www.facebook.com/Oleksandr.S.Zhabenko/posts/pfbid03qAMdEk6ehnQjQXLqNeAULQiTMKJUpQYUjM1eipcJy7hkxLCMuoh7cvZVUEHUUAfl+https://www.facebook.com/Oleksandr.S.Zhabenko/posts/pfbid05mMCUu5HVoA6aV4kLJ69tQZHyhTRZgXLRvtdLitWCm6JeB2T2ktfkd2opfjjgTxFl Video recordings as examples of the working prototype usage and how you can listen to Ukrainian text using Google services are at the links below:
phladiprelio-general-simple.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: phladiprelio-general-simple-version: 0.3.0.0+version: 0.4.0.0 -- A short (one-line) description of the package. synopsis: A generalized functionality of PhLADiPreLiO for different languages that uses hash algorithms.@@ -27,7 +27,7 @@ -- LANGUAGE extensions used by modules in this package. other-extensions: NoImplicitPrelude- build-depends: base >=4.13 && <5, rhythmic-sequences ==0.3.0.0, phonetic-languages-phonetics-basics ==0.10.0.2, phladiprelio-general-shared ==0.1.0.0, cli-arguments ==0.7.0.0, phonetic-languages-permutations-array ==0.4.0.0, phonetic-languages-constraints-array ==0.2.0.0, phonetic-languages-simplified-base ==0.7.0.0+ build-depends: base >=4.13 && <5, rhythmic-sequences ==0.3.0.0, phonetic-languages-phonetics-basics ==0.10.0.2, phladiprelio-general-shared ==0.1.0.0, cli-arguments ==0.7.0.0, phonetic-languages-permutations-array ==0.4.0.0, phonetic-languages-constraints-array ==0.6.1.1, phonetic-languages-simplified-base ==0.7.0.0 hs-source-dirs: . default-language: Haskell2010