packages feed

phonetic-languages-plus-0.7.1.0: Main.hs

-- |
-- Module      :  Main
-- Copyright   :  (c) Oleksandr Zhabenko 2020-2023
-- License     :  MIT
-- Stability   :  Experimental
-- Maintainer  :  olexandr543@yahoo.com
--
-- Analyzes a text, for every line prints statistic data and
-- then for the whole text prints the hypothesis evaluation information.
-- Is used in pair with some other programs, e. g. with propertiesTextG3 and propertiesTextG4.
-- 
--
-- To enable parallel computations (potentially, they can speed up the work), please, run the @distributionTextG@ executable with
-- @+RTS -threaded -RTS@ command line options with possibly @-N@ option inside.
--

{-# OPTIONS_GHC -threaded -rtsopts #-}

{-# LANGUAGE BangPatterns, NoImplicitPrelude #-}

module Main where

import GHC.Base
import System.Environment
import System.IO
import Phladiprelio.Distribution
import GHC.List

main :: IO ()
main = do
  args00 <- getArgs
  let !multiprop = any (== "+m") args00 -- If 'True' then uses multiple properties mode.
      !pairwisePermutations = any (== "+p") args00
      !whitelines = any (== "+W") args00 -- Usually, if specified -- the third argument
      !args0 = filter (\xs -> xs /= "+p" && xs /= "+m" && xs /= "+W") args00
      !gzS = mconcat . take 1 $ args0
      !printInput = mconcat . drop 1 . take 2 $ args0
  contents <- getContents
  if printInput == "1" then putStr contents else putStr empty
  innerProcG pairwisePermutations whitelines gzS multiprop contents