Skip to content

Commit

Permalink
Fixed issue with halfsplit1G function
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr-Zhabenko committed Nov 18, 2024
1 parent 9676375 commit d228670
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Aftovolio/Halfsplit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import GHC.Num (abs, (+), (-))
import GHC.Real (quot, quotRem)
import System.IO (getLine, putStr, putStrLn)
import Text.Show (Show (..))
import Debug.Trace

-- | Converts the data that is an instance of 'Show' typeclass to be printed in two-column way.
halfsplit ::
Expand Down Expand Up @@ -74,13 +75,13 @@ halfsplit1G g filtering appendstr m xs
(y100s, t10s) = splitAt l2 . concat $ rss
y10s
| r20 == 0 = y100s
| otherwise = replicate l0 ' ' : y10s
| otherwise = replicate l0 ' ' : y100s
r1ss = intersperse [replicate l0 ' '] rss -- For groupping with empty lines
(l3, r30) = (sum . map length $ r1ss) `quotRem` 2
(y200s, t20s) = splitAt l3 . concat $ r1ss
y20s
| r30 == 0 = y200s
| otherwise = replicate l0 ' ' : y20s
| otherwise = replicate l0 ' ' : y200s

-- | A generalized version of 'halfsplit3G' with the possibility to prepend and append strings to it. These 'String's are not filtered out for the groups of \'={digits}\' from the prepending and appending 'String's.
halfsplit2G ::
Expand Down
2 changes: 1 addition & 1 deletion Aftovolio/Ukrainian/IO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import System.IO (
writeFile,
)
import Text.Read (readMaybe)
import Text.Show (Show (..))
--import Text.Show (Show (..))

generalF ::
-- | A power of 10. The distance value is quoted by 10 in this power if the next ['Word8'] argument is not empty. The default one is 0. The right values are in the range [0..4].
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@

* Fifth version. Removed +n command line parameter and the descending sorting of the resulting data. Changed the printing behaviour so that there is no longer too long half of the columns as empty one printed. Some code simplification in the module Aftovolio.Halfsplit. Added new constraint type G for specifying that more than two elements should be groupped together as a one whole (with possible inner permutations inside the group) during all the permutations.

## 0.5.1.0 -- 2024-11-18

* Fifth version revised A. Fixed issue with eternal loop in the halfsplit1G function.

2 changes: 1 addition & 1 deletion aftovolio.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: aftovolio
version: 0.5.0.0
version: 0.5.1.0

-- A short (one-line) description of the package.
synopsis: An AFTOVolio implementation for creating texts with special phonetic / prosodic properties.
Expand Down
2 changes: 0 additions & 2 deletions src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ main = do
gcd1 = gcd le lb
ldc = (le * lb) `quot` gcd1
mulp = ldc `quot` lb
-- max2 = maximum basecomp
compards = let ff g1 g2 ks = if isWord8Based ks then C1 . g1 . (\(C1 us) -> us) $ ks else C2 . g2 . (\(C2 us) -> us) $ ks in ff (concatMap (replicate mulp)) (concatMap (replicate mulp)) basecomp
(filesave,codesave)
| null filedata = ("",-1)
Expand All @@ -137,7 +136,6 @@ main = do
| not (null argCBs) = filterGeneralConv l argCBs . genPermutationsL $ l
| null argCs = genPermutationsL l
| otherwise = decodeLConstraints argCs . genPermutationsL $ l
-- descending = oneA "+n" argsA
variants1 = force . uniquenessVariants2GNBL ' ' id id id perms $ ll
if helpMessage then do
hSetNewlineMode stdout universalNewlineMode
Expand Down

0 comments on commit d228670

Please sign in to comment.