packages feed

phladiprelio-ukrainian-simple 0.14.1.0 → 0.15.0.0

raw patch · 4 files changed

+52/−16 lines, 4 filesdep ~phladiprelio-general-datatypePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: phladiprelio-general-datatype

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -192,7 +192,10 @@ of the call of the program with the -h command line argument. This significantly extends the general possibilities of the program, especially for the music composing. -## 0.1.1.0 -- 2023-11-23+## 0.14.1.0 -- 2023-11-23  * Fourteenth version revised A. Fixed issues with incorrectly computed arguments. +## 0.15.0.0 -- 2023-12-01++* Fifteenth version. Fixed issue with distance between line options in several branches. Added a possibility to analyse and compare two lines from the same file using either additionally to +m also +m2 group of command line arguments, or +m3 group of arguments instead.
Main.hs view
@@ -38,10 +38,7 @@       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   syllableDurationsDs <- readSyllableDurations fileDu-  let line2comparewith = unwords . getC "+l2" $ argsC-      basecomp = read3 (not . null . filter (not . isSpace)) 1.0 (mconcat . (if null fileDu then case sylD of { 1 -> syllableDurationsD; 2 -> syllableDurationsD2; 3 -> syllableDurationsD3; 4 -> syllableDurationsD4} -                         else  if length syllableDurationsDs >= sylD then syllableDurationsDs !! (sylD - 1) else syllableDurationsD2) . createSyllablesUkrS) line2comparewith-      maxNumWords = let k = fromMaybe 7 (readMaybe (concat . getB "+x" $ argsB)::Maybe Int) in if k == 0 || abs k >= 9 then 9 else max (abs k) 2+  let maxNumWords = let k = fromMaybe 7 (readMaybe (concat . getB "+x" $ argsB)::Maybe Int) in if k == 0 || abs k >= 9 then 9 else max (abs k) 2       hc = readHashCorrections . concat . getB "+c" $ argsB       dcspecs = getB "+dc" argsB       power10' = fromMaybe 4 (readMaybe (concat . getB "+q" $ argsB)::Maybe Int)@@ -61,16 +58,31 @@       helpMessage = oneA "-h" argsA       filedata = getB "+f" argsB       concurrently = oneA "-C" argsA-      multiline2 = getB "+m" argsB+      (multiline2, multiline2LineNum) +        | oneB "+m3" argsB = +            let r1ss = getB "+m3" argsB in +                  if length r1ss == 3 +                      then let (kss,qss) = splitAt 2 r1ss in +                                   (kss, max 1 (fromMaybe 1 (readMaybe (concat qss)::Maybe Int))) +                      else (r1ss, 1)+        | oneB "+m2" argsB = (getB "+m" argsB,  max 1 (fromMaybe 1 (readMaybe (concat . getB "+m2" $ argsB)::Maybe Int)))+        | otherwise = (getB "+m" argsB, -1)       (fileread,lineNmb)         | null multiline2 = ("",-1)         | length multiline2 == 2 = (head multiline2, fromMaybe 1 (readMaybe (last multiline2)::Maybe Int))         | otherwise = (head multiline2, 1)-  (arg3s,prestr,poststr) <- do +  (arg3s,prestr,poststr,linecomp3) <- do         if lineNmb /= -1 then do            txtFromFile <- readFile fileread            let lns = lines txtFromFile+               ll1 = length lns                ln0 = max 1 (min lineNmb (length lns))+               lm3 +                 | multiline2LineNum < 1 = -1+                 | otherwise = max 1 . min multiline2LineNum $ ll1+               linecomp3 +                 | lm3 == -1 = []+                 | otherwise = lns !! (lm3 - 1)                ln_1                    | ln0 == 1 = 0                   | otherwise = ln0 - 1@@ -84,9 +96,15 @@                line1F                   | ln1 == 0 = []                   | otherwise = lns !! (ln1 - 1)-           return $ (words lineF, line_1F,line1F)-       else return (arg2s, [], [])-  let example = read3 (not . null . filter (not . isSpace)) 1.0 (mconcat . (if null fileDu then case sylD of { 1 -> syllableDurationsD; 2 -> syllableDurationsD2; 3 -> syllableDurationsD3; 4 -> syllableDurationsD4} +           return $ (words lineF, line_1F,line1F,linecomp3)+       else return (arg2s, [], [],[])+  let line2comparewith +        | oneC "+l2" argsC || null linecomp3 = unwords . getC "+l2" $ argsC+        | otherwise = linecomp3+      basecomp = read3 (not . null . filter (not . isSpace)) 1.0 (mconcat . (if null fileDu then case sylD of { 1 -> syllableDurationsD; 2 -> syllableDurationsD2; 3 -> syllableDurationsD3; 4 -> syllableDurationsD4} +                         else  if length syllableDurationsDs >= sylD then syllableDurationsDs !! (sylD - 1) else syllableDurationsD2) . createSyllablesUkrS) line2comparewith++      example = read3 (not . null . filter (not . isSpace)) 1.0 (mconcat . (if null fileDu then case sylD of { 1 -> syllableDurationsD; 2 -> syllableDurationsD2; 3 -> syllableDurationsD3; 4 -> syllableDurationsD4}                           else  if length syllableDurationsDs >= sylD then syllableDurationsDs !! (sylD - 1) else syllableDurationsD2) . createSyllablesUkrS) (unwords arg3s)       le = length example       lb = length basecomp@@ -101,8 +119,7 @@         | otherwise = (head filedata,0)       ll = take maxNumWords . (if prepare then id else words . mconcat . prepareTextN3 maxNumWords . unwords) $ arg3s       l = length ll-      argCs = catMaybes (fmap (readMaybeECG l) -- . (showB l lstW2:)-                                                    . getC "+a" $ argsC)+      argCs = catMaybes (fmap (readMaybeECG l) . getC "+a" $ argsC)       !perms          | not (null argCBs) = filterGeneralConv l argCBs . genPermutationsL $ l         | null argCs = genPermutationsL l@@ -123,6 +140,12 @@       putStrLn "OR:"       putStrLn "phladiprelioUkr [[+a <PhLADiPreLiO constraints> -a] [+b <extended algebraic PhLADiPreLiO constraints> -b] [+n] [+l] [+d <FilePath to file with durations>] [+s <syllable durations function number>] [-p] [+w <splitting parameter>] [+q <power of 10 for multiplier in [2..6]>] [+f <FilePath to the file to be appended the resulting String> <control parameter for output parts>] [+x <maximum number of words taken>] [+dc <whether to print <br> tag at the end of each line for two-column output> <FilePath to the file where the two-column output will be written in addition to stdout>] [+l2 <a Ukrainian text line to compare similarity with> -l2]] <Ukrainian textual line>"       putStrLn ""+      putStrLn "OR:"+      putStrLn "phladiprelioUkr [[+a <PhLADiPreLiO constraints> -a] [+b <extended algebraic PhLADiPreLiO constraints> -b] [+n] [+l] [+d <FilePath to file with durations>] [+s <syllable durations function number>] [-p] [+w <splitting parameter>] [+q <power of 10 for multiplier in [2..6]>] [+f <FilePath to the file to be appended the resulting String> <control parameter for output parts>] [+x <maximum number of words taken>] [+dc <whether to print <br> tag at the end of each line for two-column output> <FilePath to the file where the two-column output will be written in addition to stdout>] [+m <FilePath> <num1> +m2 <num2>]]"+      putStrLn ""+      putStrLn "OR:"+      putStrLn "phladiprelioUkr [[+a <PhLADiPreLiO constraints> -a] [+b <extended algebraic PhLADiPreLiO constraints> -b] [+n] [+l] [+d <FilePath to file with durations>] [+s <syllable durations function number>] [-p] [+w <splitting parameter>] [+q <power of 10 for multiplier in [2..6]>] [+f <FilePath to the file to be appended the resulting String> <control parameter for output parts>] [+x <maximum number of words taken>] [+dc <whether to print <br> tag at the end of each line for two-column output> <FilePath to the file where the two-column output will be written in addition to stdout>] [+m3 <FilePath> <num1> <num2>]]"+      putStrLn ""       putStrLn "+n \t— if specified then the order of sorting and printing is descending (the reverse one to the default otherwise). "       putStrLn ""       putStrLn "+l \t— if specified then the output for one property (no tests) contains empty lines between the groups of the line option with the same value of property. "@@ -171,6 +194,12 @@       putStrLn ""       putStrLn "+m \t— If present followed with two arguments — the name of the file to be used for reading data for multiline processment and the second one — the number of line to be processed. The numeration of the lines in the file for the phladiprelioUkr program here starts from 1 (so, it is: 1, 2, 3, 4,.. etc). The program then uses instead of text the specified line from the file specified here and prints information about its previous and next lines (if available)."       putStrLn ""+      putStrLn "+m2 \t— If present, it means that the line with the corresponding number specified here will be taken from the same file specified as +m <file>. For example, the entry +m <file> 1 +m2 4 means that 1 line will be taken from the file <file> for the similarity analysis and it will be compared not with contents of +l2 ... -l2, but with the 4th line from the same file. "+      putStrLn ""+      putStrLn "The abbreviation for +m <file> <num1> +m2 <num2> is +m3 <file> <num1> <num2>, which has the same meaning but a slightly shorter entry. "+      putStrLn ""+      putStrLn "If <num1> == <num2>, then there is at least one of all the options with a property value of 0."+      putStrLn ""       putStrLn "You can also use the \"music\" mode, which allows you to write better lyrics and music. To do this, you can add a record of the form _{set of digits} or ={set of digits} to a word or between syllables after the needed to be referred to, and this set of digits will be converted to a positive double-precision number by the program so that the first digit in the record is a whole number and the rest is a fraction (mantissa)."        putStrLn "If you have added _{set of digits} then this number will be multiplied by the duration of the syllable to which this insertion refers, and the resulting number will be placed among the others in the place where this entry is inserted. "       putStrLn "If you have added ={a set of digits} then this number will also be multiplied by the duration of the syllable to which this insertion refers, and the resulting number will be placed instead the duration that it was multiplied by. This allows to make syllables longer or shorter to follow language or creative intentions and rules (e. g. in French there have been noticed that the duration of the last syllable in the word, especially in the sentence or phrase is prolonged to some extent, so you can use '=12' or '=13' or '=14'  here). Not as for the _{set of digits} group, you can place it only after the syllable and only once to change the duration of the syllable. If you use this option, the following _{set of digits} will be referred to the new changed duration here, so that \"так\"=2_05_1 will mean that you will use instead of the usual duration of the syllable \"так\" the twice as much duration, and then half of this twice as much (therefore, equal to duration of the syllable without altering) and then again the twice as much duration etc. The insertion of =1, =10, =100, =1000 etc will not change anything at all, except for the time of computations (you probably do not need this). "@@ -186,7 +215,7 @@   bSpecs :: CLSpecifications-bSpecs = (zip ["+c","+d","+k","+r","+s","-t","+ul","+w","+x","+q"] . cycle $ [1]) `mappend` [("+f",2),("+m",2),("+dc",2)] +bSpecs = (zip ["+c","+d","+k","+r","+s","-t","+ul","+w","+x","+q","+m2"] . cycle $ [1]) `mappend` [("+f",2),("+m",2),("+dc",2),("+m3",3)]   aSpecs :: CLSpecifications aSpecs = zip ["-h", "+l", "+n","-p", "-C"] . cycle $ [0]
README.md view
@@ -64,6 +64,8 @@ of the call of the program with the -h command line argument. This significantly extends the general possibilities of the program, especially for the music composing. +Since the version 0.15.0.0 there were fixed issues with distance between line options in several branches and added a possibility to analyse and compare two lines from the same file using either additionally to +m also +m2 group of command line arguments, or +m3 group of arguments instead.+ To see the help message with synopsis information, run:  phladiprelioUkr -h@@ -113,6 +115,8 @@ On the 27/10/2023 there is Ukrainian Language and Writing Day.  On the 11/11/2023 there is St. Martin of Tours Day for Roman Catholics and Poland Independence Day.++The version 0.15.0.0 is also devoted to the bright memory of the Artem Sachuk, who perished as a soldier defending Ukraine from the Russian occupants. Kingdom of God to his soul and eternal memory! Condolences to everybody who knows him.  All support is welcome, including donations for the needs of the Ukrainian army, IDPs and refugees. 
phladiprelio-ukrainian-simple.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.4 name:               phladiprelio-ukrainian-simple-version:            0.14.1.0+version:            0.15.0.0  -- A short (one-line) description of the package. synopsis:           A PhLADiPreLiO implementation for Ukrainian that uses hashes and asynchronous concurrency.@@ -28,7 +28,7 @@      -- LANGUAGE extensions used by modules in this package.     other-extensions: NoImplicitPrelude, BangPatterns-    build-depends:    base >=4.13 && <5, rhythmic-sequences ==0.4.1.0, ukrainian-phonetics-basic-array ==0.7.0.0, phonetic-languages-ukrainian-array ==0.12.1.0, phladiprelio-ukrainian-shared ==0.1.0.0, cli-arguments ==0.7.0.0, phonetic-languages-permutations-array ==0.4.0.0, phonetic-languages-constraints-array ==0.7.3.0, phonetic-languages-simplified-base ==0.7.1.0, halfsplit ==0.4.2.0, directory >=1.3.4.0 && <2, rev-scientific ==0.2.1.0, async >= 2.2.2 && <3, phladiprelio-tests ==0.1.0.0, phladiprelio-general-datatype ==0.5.1.0, mmsyn2-array ==0.3.1.1, phonetic-languages-basis ==0.3.0.0+    build-depends:    base >=4.13 && <5, rhythmic-sequences ==0.4.1.0, ukrainian-phonetics-basic-array ==0.7.0.0, phonetic-languages-ukrainian-array ==0.12.1.0, phladiprelio-ukrainian-shared ==0.1.0.0, cli-arguments ==0.7.0.0, phonetic-languages-permutations-array ==0.4.0.0, phonetic-languages-constraints-array ==0.7.3.0, phonetic-languages-simplified-base ==0.7.1.0, halfsplit ==0.4.2.0, directory >=1.3.4.0 && <2, rev-scientific ==0.2.1.0, async >= 2.2.2 && <3, phladiprelio-tests ==0.1.0.0, phladiprelio-general-datatype ==0.5.2.0, mmsyn2-array ==0.3.1.1, phonetic-languages-basis ==0.3.0.0     hs-source-dirs:   .     default-language: Haskell2010 @@ -40,7 +40,7 @@     ghc-options:      -threaded -rtsopts     -- LANGUAGE extensions used by modules in this package.     other-extensions: NoImplicitPrelude, BangPatterns-    build-depends:    base >=4.13 && <5, rhythmic-sequences ==0.4.1.0, ukrainian-phonetics-basic-array ==0.7.0.0, phonetic-languages-ukrainian-array ==0.12.1.0, phladiprelio-ukrainian-shared ==0.1.0.0, cli-arguments ==0.7.0.0, phonetic-languages-permutations-array ==0.4.0.0, phonetic-languages-constraints-array ==0.7.3.0, phonetic-languages-simplified-base ==0.7.1.0, halfsplit ==0.4.2.0, directory >=1.3.4.0 && <2, rev-scientific ==0.2.1.0, async >= 2.2.2 && <3, phladiprelio-tests ==0.1.0.0, phladiprelio-general-datatype ==0.5.1.0, mmsyn2-array ==0.3.1.1, phonetic-languages-basis ==0.3.0.0+    build-depends:    base >=4.13 && <5, rhythmic-sequences ==0.4.1.0, ukrainian-phonetics-basic-array ==0.7.0.0, phonetic-languages-ukrainian-array ==0.12.1.0, phladiprelio-ukrainian-shared ==0.1.0.0, cli-arguments ==0.7.0.0, phonetic-languages-permutations-array ==0.4.0.0, phonetic-languages-constraints-array ==0.7.3.0, phonetic-languages-simplified-base ==0.7.1.0, halfsplit ==0.4.2.0, directory >=1.3.4.0 && <2, rev-scientific ==0.2.1.0, async >= 2.2.2 && <3, phladiprelio-tests ==0.1.0.0, phladiprelio-general-datatype ==0.5.2.0, mmsyn2-array ==0.3.1.1, phonetic-languages-basis ==0.3.0.0     hs-source-dirs:   .     default-language: Haskell2010