phladiprelio-ukrainian-simple (empty) → 0.1.0.0
raw patch · 4 files changed
+104/−0 lines, 4 filesdep +basedep +cli-argumentsdep +phladiprelio-ukrainian-shared
Dependencies added: base, cli-arguments, phladiprelio-ukrainian-shared, phonetic-languages-ukrainian-array, rhythmic-sequences, ukrainian-phonetics-basic-array
Files
- CHANGELOG.md +5/−0
- README.md +18/−0
- app/Main.hs +46/−0
- phladiprelio-ukrainian-simple.cabal +35/−0
+ CHANGELOG.md view
@@ -0,0 +1,5 @@+# Revision history for phladiprelio-ukrainian-simple++## 0.1.0.0 -- 2023-03-12++* First version. Released on an unsuspecting world.
+ README.md view
@@ -0,0 +1,18 @@+The executable is the new implementation of the ideas related to PhLADiPreLiO (Phonetic Languages+Approach to Discovering the Preferred Line Options) for Ukrainian language. It uses hashes and+has at the moment (as of the version 0.1.0.0) not the full functionality. The previous implementation +and its documentation are at the links:++https://hackage.haskell.org/package/phonetic-languages-simplified-examples-array++https://oleksandrzhabenko.github.io/uk/rhythmicity/PhLADiPreLiO.Ukr.21.pdf (Ukrainian documentation)+https://oleksandrzhabenko.github.io/uk/rhythmicity/PhLADiPreLiO.Eng.21.pdf (English documentation)++P.S.: the author would like to devote this project to support the Fund GASTROSTARS.+At the day of publication of the first version of the package (12/03/2023) there is+the Fund foundator's (this is Emma Kok) Birthday.+If you would like to share some financial support, please, contact the fund+using the URL:++https://gastrostars.nl/hou-mij-op-de-hoogte+
+ app/Main.hs view
@@ -0,0 +1,46 @@+{-# LANGUAGE NoImplicitPrelude #-}++module Main where++import GHC.Base+import GHC.Num ((-))+import Text.Show (show)+import Text.Read (readMaybe)+import System.IO (putStrLn, FilePath)+import Rhythmicity.MarkerSeqs hiding (id) +import Rhythmicity.BasicF +import Data.List+import Data.Maybe (fromMaybe) +import Data.Tuple (fst,snd)+import Phladiprelio.Ukrainian.PrepareText +import Phladiprelio.Ukrainian.Syllable +import Phladiprelio.Ukrainian.SyllableDouble +import System.Environment (getArgs)+import GHC.Int (Int8)+import CLI.Arguments+import CLI.Arguments.Get+import CLI.Arguments.Parsing+import Phladiprelio.Ukrainian.ReadDurations++generalF :: FilePath -> HashCorrections -> (Int8,[Int8]) -> Int -> String -> IO [()]+generalF file hc (grps,mxms) k rs = do+ syllableDurationsDs <- readSyllableDurations file+ mapM (\(x,y) -> putStrLn (show x `mappend` (' ':y))) . sortOn id . map ((\xss -> (f syllableDurationsDs xss, xss)) . unwords) . permutations . words $ rs+ where f syllableDurationsDs = sum . countHashesG hc grps mxms . mconcat . + (if null file then case k of { 1 -> syllableDurationsD; 2 -> syllableDurationsD2; 3 -> syllableDurationsD3; 4 -> syllableDurationsD4} + else if length syllableDurationsDs >= k then syllableDurationsDs !! (k - 1) else syllableDurationsD2) . createSyllablesUkrS++main :: IO ()+main = do+ args <- getArgs+ let (argsB, arg2s) = takeBsR bSpecs args+ fileDu = concat . getB "+d" $ argsB+ sylD = let k = snd (fromMaybe 2 (readMaybe (concat . getB "+s" $ argsB)::Maybe Int) `quotRemInt` 4) in if k == 0 then 4 else k+ hc = readHashCorrections . concat . getB "+h" $ argsB+ grpp = grouppingR . concat . getB "+r" $ argsB+ str1 = unwords . take 7 . words . mconcat . prepareText . unwords $ arg2s+ generalF fileDu hc grpp sylD str1 >> return ()++bSpecs :: CLSpecifications+bSpecs = zip ["+d","+h","+r","+s"] . cycle $ [1]+
+ phladiprelio-ukrainian-simple.cabal view
@@ -0,0 +1,35 @@+cabal-version: 2.4+name: phladiprelio-ukrainian-simple+version: 0.1.0.0++-- A short (one-line) description of the package.+synopsis: A PhLADiPreLiO implementation for Ukrainian that uses hashes++-- A longer description of the package.+description: It is another project that is based on the similar ideas as phonetic-languages-simplified-examples-array package (https://hackage.haskell.org/package/phonetic-languages-simplified-examples-array). For documentation for these ideas, see: https://oleksandrzhabenko.github.io/uk/rhythmicity/PhLADiPreLiO.Ukr.21.pdf https://oleksandrzhabenko.github.io/uk/rhythmicity/PhLADiPreLiO.Eng.21.pdf++-- A URL where users can report bugs.+-- bug-reports:++-- The license under which the package is released.+license: MIT+author: Oleksandr Zhabenko+maintainer: oleksandr.zhabenko@yahoo.com++-- A copyright notice.+copyright: Oleksandr Zhabenko+-- category:+extra-source-files: CHANGELOG.md, README.md++executable phladiprelioUkr+ main-is: Main.hs++ -- Modules included in this executable, other than Main.+ -- other-modules:++ -- LANGUAGE extensions used by modules in this package.+ -- other-extensions:+ build-depends: base >=4.13 && <5, rhythmic-sequences ==0.2.0.0, ukrainian-phonetics-basic-array ==0.7.0.0, phonetic-languages-ukrainian-array ==0.10.0.0, phladiprelio-ukrainian-shared ==0.1.0.0, cli-arguments ==0.7.0.0+ hs-source-dirs: app+ default-language: Haskell2010+