packages feed

Encode 1.3.5 → 1.3.6

raw patch · 33 files changed

+569/−462 lines, 33 filesdep ~base

Dependency ranges changed: base

Files

Encode.cabal view
@@ -1,15 +1,15 @@ name:               Encode-version:            1.3.5+version:            1.3.6 license:            GPL license-file:       LICENSE extra-source-files: INSTALL, Setup.PL-copyright:          2011+copyright:          2013 author:             Otakar Smrz-maintainer:         otakar.smrz mff.cuni.cz-homepage:           http://ufal.mff.cuni.cz/~smrz/+maintainer:         otakar-smrz users.sf.net+homepage:           http://otakar-smrz.users.sf.net/ package-url:        http://sourceforge.net/projects/encode-arabic/ category:           Text, Codec-build-depends:      Cabal, base < 4.4, mtl, containers+build-depends:      Cabal, base < 5.0, mtl, containers build-type:         Simple synopsis:           Encoding character data description:        The "Encode" library provides a unified interface for converting strings@@ -22,9 +22,8 @@                     The "Encode" library is being proposed as a Haskell analogy to the                     /Encode/ extension in Perl, <http://search.cpan.org/dist/Encode/>.                     .-                    The "Exec.Encode.Main" and "Exec.Decode.Main" programs mimick the-                    function calls to 'encode' and 'decode', respectively, with the-                    following usage of the executables:+                    The "Main.Encode" and "Main.Decode" programs mimick the function calls+                    to 'encode' and 'decode', respectively, with the following usage:                     .                     >    decode ArabTeX < decode.d | encode Buckwalter > encode.d                     >@@ -49,13 +48,14 @@                     library developed by Peter Ljungl&#246;f in his licenciate thesis                     /Pure Functional Parsing &#150; an advanced tutorial/, G&#246;teborg                     University and Chalmers University of Technology, April 2002,-                    <http://www.ling.gu.se/~peb/software.html>.+                    <http://code.google.com/p/haskell-functional-parsing/>.                     .                     The "Parsek" library is included for experimental purposes and subsumes                     "PureFP.Parsers.Stream". /Parsek/ was developed by Koen Claessen in his                     functional pearl article /Parallel Parsing Processes/, Journal of                     Functional Programming, 14(6), 741&#150;757, Cambridge University Press,-                    2004, <http://www.cs.chalmers.se/~koen/pubs/entry-jfp04-parser.html>.+                    2004, <http://www.cse.chalmers.se/edu/course/afp/Papers/parser-claessen.pdf>,+                    <http://hackage.haskell.org/package/parsek/>.                     .                     "Encode" "PureFP" "Parsek" exposed-modules:    Encode,@@ -63,6 +63,8 @@                             Encode.Arabic.ArabTeX,                                 Encode.Arabic.ArabTeX.ZDMG,                             Encode.Arabic.Buckwalter,+                            Encode.Arabic.Parkinson,+                            Encode.Arabic.Habash,                             Encode.Arabic.Byte,                         Encode.Extend,                         Encode.ExPlus,@@ -93,12 +95,14 @@ hugs-options:       -98 +o +u -h96M  executable:         encode-main-is:            Exec/Encode/Main.hs+main-is:            Main/Encode.hs other-modules:      Encode,                         Encode.Arabic,                             Encode.Arabic.ArabTeX,                                 Encode.Arabic.ArabTeX.ZDMG,                             Encode.Arabic.Buckwalter,+                            Encode.Arabic.Parkinson,+                            Encode.Arabic.Habash,                             Encode.Arabic.Byte,                         Encode.Extend,                         Encode.ExPlus,@@ -129,12 +133,14 @@ hugs-options:       -98 +o +u -h96M  executable:         decode-main-is:            Exec/Decode/Main.hs+main-is:            Main/Decode.hs other-modules:      Encode,                         Encode.Arabic,                             Encode.Arabic.ArabTeX,                                 Encode.Arabic.ArabTeX.ZDMG,                             Encode.Arabic.Buckwalter,+                            Encode.Arabic.Parkinson,+                            Encode.Arabic.Habash,                             Encode.Arabic.Byte,                         Encode.Extend,                         Encode.ExPlus,
Encode.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 1006 $ $Date: 2011-04-21 09:39:00 +0200 (Thu, 21 Apr 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  Encode -- Copyright   :  Otakar Smrz 2005-2011 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
Encode/Arabic.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 1006 $ $Date: 2011-04-21 09:39:00 +0200 (Thu, 21 Apr 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  Encode.Arabic--- Copyright   :  Otakar Smrz 2005-2011+-- Copyright   :  Otakar Smrz 2005-2012 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --@@ -18,6 +14,9 @@ -- "Encode.Arabic.ArabTeX" -- "Encode.Arabic.ArabTeX.ZDMG" -- "Encode.Arabic.Buckwalter"+-- "Encode.Arabic.Parkinson"+-- "Encode.Arabic.Habash"+-- "Encode.Arabic.Byte"   module Encode.Arabic (@@ -27,6 +26,8 @@         module Encode.Arabic.ArabTeX,         module Encode.Arabic.ArabTeX.ZDMG,         module Encode.Arabic.Buckwalter,+        module Encode.Arabic.Parkinson,+        module Encode.Arabic.Habash,         module Encode.Arabic.Byte,          module Encode.Unicode@@ -39,6 +40,8 @@ import Encode.Arabic.ArabTeX import Encode.Arabic.ArabTeX.ZDMG import Encode.Arabic.Buckwalter+import Encode.Arabic.Parkinson+import Encode.Arabic.Habash import Encode.Arabic.Byte  import Encode.Unicode
Encode/Arabic/ArabTeX.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 1010 $ $Date: 2011-06-17 01:41:07 +0200 (Fri, 17 Jun 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  Encode.Arabic.ArabTeX -- Copyright   :  Otakar Smrz 2005-2011 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
Encode/Arabic/ArabTeX/ZDMG.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 1006 $ $Date: 2011-04-21 09:39:00 +0200 (Thu, 21 Apr 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  Encode.Arabic.ArabTeX.ZDMG -- Copyright   :  Otakar Smrz 2005-2011 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
Encode/Arabic/Buckwalter.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 1010 $ $Date: 2011-06-17 01:41:07 +0200 (Fri, 17 Jun 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  Encode.Arabic.Buckwalter -- Copyright   :  Otakar Smrz 2005-2011 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
Encode/Arabic/Byte.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 1006 $ $Date: 2011-04-21 09:39:00 +0200 (Thu, 21 Apr 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  Encode.Arabic.Byte -- Copyright   :  Otakar Smrz 2005-2011 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
+ Encode/Arabic/Habash.hs view
@@ -0,0 +1,97 @@+-- |+--+-- Module      :  Encode.Arabic.Habash+-- Copyright   :  Otakar Smrz 2005-2012+-- License     :  GPL+--+-- Maintainer  :  otakar-smrz users.sf.net+-- Stability   :  provisional+-- Portability :  portable+--+-- Habash-Soudi-Buckwalter notation is a one-to-one transliteration of the+-- graphemes of the Arabic script into various symbols of Unicode defined in+-- <http://scholar.google.com/scholar?q=habash+soudi+buckwalter>.+--+-- /Encode::Arabic::Habash/ in Perl:+-- <http://search.cpan.org/dist/Encode-Arabic/lib/Encode/Arabic/Habash.pm>+++module Encode.Arabic.Habash (++        -- * Types++        Habash (..)++    ) where+++import Encode++import Data.Map (Map)+import qualified Data.Map as Map+++data Habash = Habash | Soudi | HSB++    deriving (Enum, Show)+++instance Encoding Habash where++    encode _ = recode encoder++    decode _ = recode decoder+++recode :: (Ord a, Enum b, Enum a) => Map a b -> [a] -> [b]++recode xry xs = [ Map.findWithDefault ((toEnum . fromEnum) x) x xry | x <- xs ]+++recoder :: Ord a => [a] -> [b] -> Map a b++recoder xs ys = Map.fromList (zip xs ys)+++encoder :: Map UPoint Char++encoder = recoder decoded encoded+++decoder :: Map Char UPoint++decoder = recoder encoded decoded+++decoded :: [UPoint]++decoded = map toEnum++       [0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628,+        0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F, 0x0630,+        0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, 0x0638,+        0x0639, 0x063A, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646,+        0x0647, 0x0648, 0x0649, 0x064A, 0x064E, 0x064F, 0x0650, 0x064B,+        0x064C, 0x064D, 0x0651, 0x0652, 0x0670, 0x0671, 0x067E, 0x0686,+        0x06A4, 0x06AF, 0x0640,+        0x0698,+        0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667,+        0x0668, 0x0669,+        0x060C, 0x061B, 0x061F]+++encoded :: [Char]++encoded = map toEnum++       [0x0027, 0x0100, 0x00C2, 0x0175, 0x01CD, 0x0177, 0x0041, 0x0062,+        0x0127, 0x0074, 0x03B8, 0x006A, 0x0048, 0x0078, 0x0064, 0x00F0,+        0x0072, 0x007A, 0x0073, 0x0161, 0x0053, 0x0044, 0x0054, 0x010E,+        0x03C2, 0x03B3, 0x0066, 0x0071, 0x006B, 0x006C, 0x006D, 0x006E,+        0x0068, 0x0077, 0x00FD, 0x0079, 0x0061, 0x0075, 0x0069, 0x00E3,+        0x0169, 0x0129, 0x007E, 0x00B7, 0x00E1, 0x00C4, 0x0070, 0x0063,+        0x0076, 0x0067, 0x005F,+        0x017E,+        0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,+        0x0038, 0x0039,+        0x002C, 0x003B, 0x003F]
+ Encode/Arabic/Parkinson.hs view
@@ -0,0 +1,94 @@+-- |+--+-- Module      :  Encode.Arabic.Parkinson+-- Copyright   :  Otakar Smrz 2005-2012+-- License     :  GPL+--+-- Maintainer  :  otakar-smrz users.sf.net+-- Stability   :  provisional+-- Portability :  portable+--+-- Dil Parkinson's notation is a one-to-one transliteration of the graphemes+-- of the Arabic script using lower ASCII characters only.+--+-- /Encode::Arabic::Parkinson/ in Perl:+-- <http://search.cpan.org/dist/Encode-Arabic/lib/Encode/Arabic/Parkinson.pm>+++module Encode.Arabic.Parkinson (++        -- * Types++        Parkinson (..)++    ) where+++import Encode++import Data.Map (Map)+import qualified Data.Map as Map+++data Parkinson = Parkinson | Dil++    deriving (Enum, Show)+++instance Encoding Parkinson where++    encode _ = recode encoder++    decode _ = recode decoder+++recode :: (Ord a, Enum b, Enum a) => Map a b -> [a] -> [b]++recode xry xs = [ Map.findWithDefault ((toEnum . fromEnum) x) x xry | x <- xs ]+++recoder :: Ord a => [a] -> [b] -> Map a b++recoder xs ys = Map.fromList (zip xs ys)+++encoder :: Map UPoint Char++encoder = recoder decoded encoded+++decoder :: Map Char UPoint++decoder = recoder encoded decoded+++decoded :: [UPoint]++decoded = map toEnum ( []++            ++ [0x0623, 0x0624, 0x0625]+            ++ [0x060C, 0x061B, 0x061F]+            ++ [0x0621, 0x0622] ++ [0x0626 .. 0x063A] ++ [0x0641 .. 0x064A]+            ++ [0x0660 .. 0x0669]+            ++ [0x0671]+            ++ [0x0651]+            ++ [0x064B .. 0x0650] ++ [0x0670] ++ [0x0652]+            ++ [0x0640]++            )+++encoded :: [Char]++encoded = map id ( []++            ++ "LWE"+            ++ ",;?"+            ++ "CM" ++ "YAbQtVjHxdvrzspSDTZcg" ++ "fqklmnhwey"+            ++ ['0' .. '9']+            ++ "O"+            ++ "~"+            ++ "NUIaui" ++ "R" ++ "o"+            ++ "_"++            )
Encode/ExPlus.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 1006 $ $Date: 2011-04-21 09:39:00 +0200 (Thu, 21 Apr 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  Encode.ExPlus -- Copyright   :  Otakar Smrz 2005-2011 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
Encode/Extend.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 1006 $ $Date: 2011-04-21 09:39:00 +0200 (Thu, 21 Apr 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  Encode.Extend -- Copyright   :  Otakar Smrz 2005-2011 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
Encode/Mapper.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 1006 $ $Date: 2011-04-21 09:39:00 +0200 (Thu, 21 Apr 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  Encode.Mapper -- Copyright   :  Otakar Smrz 2005-2011 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
Encode/Unicode.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 1006 $ $Date: 2011-04-21 09:39:00 +0200 (Thu, 21 Apr 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  Encode.Unicode -- Copyright   :  Otakar Smrz 2005-2011 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
Encode/Unicode/UTF8.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 1006 $ $Date: 2011-04-21 09:39:00 +0200 (Thu, 21 Apr 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  Encode.Unicode.UTF8 -- Copyright   :  Otakar Smrz 2005-2011 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
Encode/Version.hs view
@@ -1,18 +1,14 @@--- -----------------------------------------------------------------------------  $Revision: 1006 $ $Date: 2011-04-21 09:39:00 +0200 (Thu, 21 Apr 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  Encode.Version--- Copyright   :  Otakar Smrz 2005-2011+-- Copyright   :  Otakar Smrz 2005-2013 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable ----- Exports the 'version' of the "Encode" library and provides support +-- Exports the 'version' of the "Encode" library and provides support -- for working with the SVN\/CVS revision keyword. The 'revised' method -- parses the '$Revision ... $' string supplied to it. Results have the -- type 'Version' of the "Data.Version" module, which is exported, too.@@ -26,21 +22,26 @@          -- * Functions -        revised, version+        showPretty, revised, version      ) where   import Data.Version +import Data.List+ import Text.ParserCombinators.ReadP  +showPretty :: Version -> String++showPretty (Version x y) = unwords ((concat . intersperse "." . map show) x : y)++ revised :: String -> Version  revised revision = fst . last . readP_to_S parseVersion $ words revision !! 1  -version = Version [1, 3, min build 5] []--    where Version [build] [] = revised "$Revision: 1006 $"+version = Version [1, 3, 6] ["April 2013"]
− Exec/Decode/Main.hs
@@ -1,155 +0,0 @@--- -----------------------------------------------------------------------------  $Revision: 1013 $ $Date: 2011-08-22 00:38:38 +0200 (Mon, 22 Aug 2011) $--- ------------------------------------------------------------------------------ |------ Module      :  Exec.Decode.Main--- Copyright   :  Otakar Smrz 2005-2011--- License     :  GPL------ Maintainer  :  otakar.smrz mff.cuni.cz--- Stability   :  provisional--- Portability :  portable------ "Encode.Arabic" "Encode.Mapper" "Encode.Unicode"---module Main where---import Encode-import Encode.Arabic-import Encode.Unicode--import System.Environment-import System.Console.GetOpt-import System.IO--import Data.Char-import Data.List--import Encode.Version---data Opts = DisplayUsage | PrintVersion | LineOriented |--            Prefix String | Suffix String--    deriving (Eq, Ord)---options :: [OptDescr Opts]--options = [ Option ['h'] ["help"]       (NoArg  DisplayUsage)-                                                "show usage information",--            Option ['l'] ["lines"]      (NoArg  LineOriented)-                                                "use line-oriented mode",--            Option ['p'] ["prefix"]     (ReqArg Prefix "text")-                                                "prefix input with text",--            Option ['s'] ["suffix"]     (ReqArg Suffix "text")-                                                "suffix input with text",--            Option ['v'] ["version"]    (NoArg  PrintVersion)-                                                "show program's version" ]---copyleft = unlines ["Encode Arabic (C) 2011-2005 Otakar Smrz",-                    "GNU General Public License http://www.gnu.org/licenses/"]--synopsis = unlines [copyleft,-                    "         http://sourceforge.net/projects/encode-arabic/",-                    "                    http://quest.ms.mff.cuni.cz/encode/",-                    "                              <otakar.smrz mff.cuni.cz>",-                    "",-                    "decode [--OPTIONS] [ENCODING]"]---main = do   args <- getArgs--            hSetBinaryMode stdin  True-            hSetBinaryMode stdout True--            hSetBuffering stdin  LineBuffering-            hSetBuffering stdout LineBuffering--            let (opts, nons, errs) = getOpt Permute options args--            if null errs then case (sort . nub) opts of--                DisplayUsage : _    ->  tell (usageInfo synopsis options)-                PrintVersion : _    ->  tell (unlines [copyleft,-                                              unwords ["Encode Arabic",-                                                       showVersion version,-                                                       "August 2011"]])-                LineOriented : _    ->  execute True (tail opts) nons-                _                   ->  execute False      opts  nons--                         else           warn (usageInfo synopsis options)---tell = hPutStr stdout---warn = hPutStr stderr---execute l opts nons = case opts of--                        [Prefix p]  -> interactPlus l e (p ++)-                        [Prefix p, Suffix s]-                                    -> interactPlus l e ((p ++) . (++ s))-                        [Suffix s]  -> interactPlus l e (++ s)-                        _           -> interactPlus l e id--    where e = case nons of  [] -> ""-                            _  -> head nons---interactPlus :: Bool -> String -> (String -> String) -> IO ()--interactPlus l e f = interact (if l then unlines . map encodes . lines-                                    else encodes)--    where encodes = encode UTF . decodes . f--          decodes = case map toLower e of--                        "arabtex"       ->  decode ArabTeX . encode UCS . decode UTF-                        "lagally"       ->  decode Lagally . encode UCS . decode UTF-                        "tex"           ->  decode TeX . encode UCS . decode UTF--                        "zdmg"          ->  decode ZDMG . encode UCS . decode UTF-                        "arabtex_zdmg"  ->  decode ArabTeX_ZDMG . encode UCS . decode UTF-                        "arabtex-zdmg"  ->  decode ArabTeX_ZDMG . encode UCS . decode UTF--                        "buckwalter"    ->  decode Buckwalter . encode UCS . decode UTF-                        "tim"           ->  decode Tim . encode UCS . decode UTF--                        "winarabic"     ->  decode WinArabic-                        "cp1256"        ->  decode CP1256-                        "windows_1256"  ->  decode Windows_1256-                        "windows-1256"  ->  decode Windows_1256--                        "isoarabic"     ->  decode ISOArabic-                        "iso_8859_6"    ->  decode ISO_8859_6-                        "iso-8859-6"    ->  decode ISO_8859_6--                        "macarabic"     ->  decode MacArabic--                        "macfarsi"      ->  decode MacFarsi--                        "dosarabic"     ->  decode DOSArabic-                        "cp864"         ->  decode CP864--                        "dosfarsi"      ->  decode DOSFarsi-                        "cp1006"        ->  decode CP1006--                        "asmo449"       ->  decode ASMO449--                        "isiri3342"     ->  decode ISIRI3342--                        _               ->  decode UTF
− Exec/Encode/Main.hs
@@ -1,155 +0,0 @@--- -----------------------------------------------------------------------------  $Revision: 1013 $ $Date: 2011-08-22 00:38:38 +0200 (Mon, 22 Aug 2011) $--- ------------------------------------------------------------------------------ |------ Module      :  Exec.Encode.Main--- Copyright   :  Otakar Smrz 2005-2011--- License     :  GPL------ Maintainer  :  otakar.smrz mff.cuni.cz--- Stability   :  provisional--- Portability :  portable------ "Encode.Arabic" "Encode.Mapper" "Encode.Unicode"---module Main where---import Encode-import Encode.Arabic-import Encode.Unicode--import System.Environment-import System.Console.GetOpt-import System.IO--import Data.Char-import Data.List--import Encode.Version---data Opts = DisplayUsage | PrintVersion | LineOriented |--            Prefix String | Suffix String--    deriving (Eq, Ord)---options :: [OptDescr Opts]--options = [ Option ['h'] ["help"]       (NoArg  DisplayUsage)-                                                "show usage information",--            Option ['l'] ["lines"]      (NoArg  LineOriented)-                                                "use line-oriented mode",--            Option ['p'] ["prefix"]     (ReqArg Prefix "text")-                                                "prefix input with text",--            Option ['s'] ["suffix"]     (ReqArg Suffix "text")-                                                "suffix input with text",--            Option ['v'] ["version"]    (NoArg  PrintVersion)-                                                "show program's version" ]---copyleft = unlines ["Encode Arabic (C) 2011-2005 Otakar Smrz",-                    "GNU General Public License http://www.gnu.org/licenses/"]--synopsis = unlines [copyleft,-                    "         http://sourceforge.net/projects/encode-arabic/",-                    "                    http://quest.ms.mff.cuni.cz/encode/",-                    "                              <otakar.smrz mff.cuni.cz>",-                    "",-                    "encode [--OPTIONS] [ENCODING]"]---main = do   args <- getArgs--            hSetBinaryMode stdin  True-            hSetBinaryMode stdout True--            hSetBuffering stdin  LineBuffering-            hSetBuffering stdout LineBuffering--            let (opts, nons, errs) = getOpt Permute options args--            if null errs then case (sort . nub) opts of--                DisplayUsage : _    ->  tell (usageInfo synopsis options)-                PrintVersion : _    ->  tell (unlines [copyleft,-                                              unwords ["Encode Arabic",-                                                       showVersion version,-                                                       "August 2011"]])-                LineOriented : _    ->  execute True (tail opts) nons-                _                   ->  execute False      opts  nons--                         else           warn (usageInfo synopsis options)---tell = hPutStr stdout---warn = hPutStr stderr---execute l opts nons = case opts of--                        [Prefix p]  -> interactPlus l e (p ++)-                        [Prefix p, Suffix s]-                                    -> interactPlus l e ((p ++) . (++ s))-                        [Suffix s]  -> interactPlus l e (++ s)-                        _           -> interactPlus l e id--    where e = case nons of  [] -> ""-                            _  -> head nons---interactPlus :: Bool -> String -> (String -> String) -> IO ()--interactPlus l e f = interact (if l then unlines . map decodes . lines-                                    else decodes)--    where decodes = encodes . decode UTF . f--          encodes = case map toLower e of--                        "arabtex"       ->  encode UTF . decode UCS . encode ArabTeX-                        "lagally"       ->  encode UTF . decode UCS . encode Lagally-                        "tex"           ->  encode UTF . decode UCS . encode TeX--                        "zdmg"          ->  encode UTF . decode UCS . encode ZDMG-                        "arabtex_zdmg"  ->  encode UTF . decode UCS . encode ArabTeX_ZDMG-                        "arabtex-zdmg"  ->  encode UTF . decode UCS . encode ArabTeX_ZDMG--                        "buckwalter"    ->  encode UTF . decode UCS . encode Buckwalter-                        "tim"           ->  encode UTF . decode UCS . encode Tim--                        "winarabic"     ->  encode WinArabic-                        "cp1256"        ->  encode CP1256-                        "windows_1256"  ->  encode Windows_1256-                        "windows-1256"  ->  encode Windows_1256--                        "isoarabic"     ->  encode ISOArabic-                        "iso_8859_6"    ->  encode ISO_8859_6-                        "iso-8859-6"    ->  encode ISO_8859_6--                        "macarabic"     ->  encode MacArabic--                        "macfarsi"      ->  encode MacFarsi--                        "dosarabic"     ->  encode DOSArabic-                        "cp864"         ->  encode CP864--                        "dosfarsi"      ->  encode DOSFarsi-                        "cp1006"        ->  encode CP1006--                        "asmo449"       ->  encode ASMO449--                        "isiri3342"     ->  encode ISIRI3342--                        _               ->  encode UTF
+ Main/Decode.hs view
@@ -0,0 +1,157 @@+-- |+--+-- Module      :  Main.Decode+-- Copyright   :  Otakar Smrz 2005-2013+-- License     :  GPL+--+-- Maintainer  :  otakar-smrz users.sf.net+-- Stability   :  provisional+-- Portability :  portable+--+-- "Encode.Arabic" "Encode.Mapper" "Encode.Unicode"+++module Main where+++import Encode+import Encode.Arabic+import Encode.Unicode++import System.Environment+import System.Console.GetOpt+import System.IO++import Data.Char+import Data.List++import Encode.Version+++data Opts = DisplayUsage | PrintVersion | LineOriented |++            Prefix String | Suffix String++    deriving (Eq, Ord)+++options :: [OptDescr Opts]++options = [ Option ['h'] ["help"]       (NoArg  DisplayUsage)+                                                "show usage information",++            Option ['l'] ["lines"]      (NoArg  LineOriented)+                                                "use line-oriented mode",++            Option ['p'] ["prefix"]     (ReqArg Prefix "text")+                                                "prefix input with text",++            Option ['s'] ["suffix"]     (ReqArg Suffix "text")+                                                "suffix input with text",++            Option ['v'] ["version"]    (NoArg  PrintVersion)+                                                "show program's version" ]+++copyleft = unlines ["Encode Arabic (C) 2013-2005 Otakar Smrz",+                    "GNU General Public License http://www.gnu.org/licenses/"]++synopsis = unlines [copyleft,+                    "         http://sourceforge.net/projects/encode-arabic/",+                    "                  http://encode-arabic.sourceforge.net/",+                    "                             <otakar-smrz users.sf.net>",+                    "",+                    "decode [--OPTIONS] [ENCODING]"]+++main = do   args <- getArgs++            hSetBinaryMode stdin  True+            hSetBinaryMode stdout True++            hSetBuffering stdin  LineBuffering+            hSetBuffering stdout LineBuffering++            let (opts, nons, errs) = getOpt Permute options args++            if null errs then case (sort . nub) opts of++                DisplayUsage : _    ->  tell (usageInfo synopsis options)+                PrintVersion : _    ->  tell (unlines [copyleft,+                                              unwords ["Encode Arabic",+                                                       showPretty version]])+                LineOriented : _    ->  execute True (tail opts) nons+                _                   ->  execute False      opts  nons++                         else           warn (usageInfo synopsis options)+++tell = hPutStr stdout+++warn = hPutStr stderr+++execute l opts nons = case opts of++                        [Prefix p]  -> interactPlus l e (p ++)+                        [Prefix p, Suffix s]+                                    -> interactPlus l e ((p ++) . (++ s))+                        [Suffix s]  -> interactPlus l e (++ s)+                        _           -> interactPlus l e id++    where e = case nons of  [] -> ""+                            _  -> head nons+++interactPlus :: Bool -> String -> (String -> String) -> IO ()++interactPlus l e f = interact (if l then unlines . map encodes . lines+                                    else encodes)++    where encodes = encode UTF . decodes . f++          decodes = case map toLower e of++                        "arabtex"       ->  decode ArabTeX . encode UCS . decode UTF+                        "lagally"       ->  decode Lagally . encode UCS . decode UTF+                        "tex"           ->  decode TeX . encode UCS . decode UTF++                        "zdmg"          ->  decode ZDMG . encode UCS . decode UTF+                        "arabtex_zdmg"  ->  decode ArabTeX_ZDMG . encode UCS . decode UTF+                        "arabtex-zdmg"  ->  decode ArabTeX_ZDMG . encode UCS . decode UTF++                        "buckwalter"    ->  decode Buckwalter . encode UCS . decode UTF+                        "tim"           ->  decode Tim . encode UCS . decode UTF++                        "parkinson"     ->  decode Parkinson . encode UCS . decode UTF+                        "dil"           ->  decode Dil . encode UCS . decode UTF++                        "habash"        ->  decode Habash . encode UCS . decode UTF+                        "soudi"         ->  decode Soudi . encode UCS . decode UTF+                        "hsb"           ->  decode HSB . encode UCS . decode UTF++                        "winarabic"     ->  decode WinArabic+                        "cp1256"        ->  decode CP1256+                        "windows_1256"  ->  decode Windows_1256+                        "windows-1256"  ->  decode Windows_1256++                        "isoarabic"     ->  decode ISOArabic+                        "iso_8859_6"    ->  decode ISO_8859_6+                        "iso-8859-6"    ->  decode ISO_8859_6++                        "macarabic"     ->  decode MacArabic++                        "macfarsi"      ->  decode MacFarsi++                        "dosarabic"     ->  decode DOSArabic+                        "cp864"         ->  decode CP864++                        "dosfarsi"      ->  decode DOSFarsi+                        "cp1006"        ->  decode CP1006++                        "asmo449"       ->  decode ASMO449++                        "isiri3342"     ->  decode ISIRI3342++                        _               ->  decode UTF
+ Main/Encode.hs view
@@ -0,0 +1,157 @@+-- |+--+-- Module      :  Main.Encode+-- Copyright   :  Otakar Smrz 2005-2013+-- License     :  GPL+--+-- Maintainer  :  otakar-smrz users.sf.net+-- Stability   :  provisional+-- Portability :  portable+--+-- "Encode.Arabic" "Encode.Mapper" "Encode.Unicode"+++module Main where+++import Encode+import Encode.Arabic+import Encode.Unicode++import System.Environment+import System.Console.GetOpt+import System.IO++import Data.Char+import Data.List++import Encode.Version+++data Opts = DisplayUsage | PrintVersion | LineOriented |++            Prefix String | Suffix String++    deriving (Eq, Ord)+++options :: [OptDescr Opts]++options = [ Option ['h'] ["help"]       (NoArg  DisplayUsage)+                                                "show usage information",++            Option ['l'] ["lines"]      (NoArg  LineOriented)+                                                "use line-oriented mode",++            Option ['p'] ["prefix"]     (ReqArg Prefix "text")+                                                "prefix input with text",++            Option ['s'] ["suffix"]     (ReqArg Suffix "text")+                                                "suffix input with text",++            Option ['v'] ["version"]    (NoArg  PrintVersion)+                                                "show program's version" ]+++copyleft = unlines ["Encode Arabic (C) 2013-2005 Otakar Smrz",+                    "GNU General Public License http://www.gnu.org/licenses/"]++synopsis = unlines [copyleft,+                    "         http://sourceforge.net/projects/encode-arabic/",+                    "                  http://encode-arabic.sourceforge.net/",+                    "                             <otakar-smrz users.sf.net>",+                    "",+                    "encode [--OPTIONS] [ENCODING]"]+++main = do   args <- getArgs++            hSetBinaryMode stdin  True+            hSetBinaryMode stdout True++            hSetBuffering stdin  LineBuffering+            hSetBuffering stdout LineBuffering++            let (opts, nons, errs) = getOpt Permute options args++            if null errs then case (sort . nub) opts of++                DisplayUsage : _    ->  tell (usageInfo synopsis options)+                PrintVersion : _    ->  tell (unlines [copyleft,+                                              unwords ["Encode Arabic",+                                                       showPretty version]])+                LineOriented : _    ->  execute True (tail opts) nons+                _                   ->  execute False      opts  nons++                         else           warn (usageInfo synopsis options)+++tell = hPutStr stdout+++warn = hPutStr stderr+++execute l opts nons = case opts of++                        [Prefix p]  -> interactPlus l e (p ++)+                        [Prefix p, Suffix s]+                                    -> interactPlus l e ((p ++) . (++ s))+                        [Suffix s]  -> interactPlus l e (++ s)+                        _           -> interactPlus l e id++    where e = case nons of  [] -> ""+                            _  -> head nons+++interactPlus :: Bool -> String -> (String -> String) -> IO ()++interactPlus l e f = interact (if l then unlines . map decodes . lines+                                    else decodes)++    where decodes = encodes . decode UTF . f++          encodes = case map toLower e of++                        "arabtex"       ->  encode UTF . decode UCS . encode ArabTeX+                        "lagally"       ->  encode UTF . decode UCS . encode Lagally+                        "tex"           ->  encode UTF . decode UCS . encode TeX++                        "zdmg"          ->  encode UTF . decode UCS . encode ZDMG+                        "arabtex_zdmg"  ->  encode UTF . decode UCS . encode ArabTeX_ZDMG+                        "arabtex-zdmg"  ->  encode UTF . decode UCS . encode ArabTeX_ZDMG++                        "buckwalter"    ->  encode UTF . decode UCS . encode Buckwalter+                        "tim"           ->  encode UTF . decode UCS . encode Tim++                        "parkinson"     ->  encode UTF . decode UCS . encode Parkinson+                        "dil"           ->  encode UTF . decode UCS . encode Dil++                        "habash"        ->  encode UTF . decode UCS . encode Habash+                        "soudi"         ->  encode UTF . decode UCS . encode Soudi+                        "hsb"           ->  encode UTF . decode UCS . encode HSB++                        "winarabic"     ->  encode WinArabic+                        "cp1256"        ->  encode CP1256+                        "windows_1256"  ->  encode Windows_1256+                        "windows-1256"  ->  encode Windows_1256++                        "isoarabic"     ->  encode ISOArabic+                        "iso_8859_6"    ->  encode ISO_8859_6+                        "iso-8859-6"    ->  encode ISO_8859_6++                        "macarabic"     ->  encode MacArabic++                        "macfarsi"      ->  encode MacFarsi++                        "dosarabic"     ->  encode DOSArabic+                        "cp864"         ->  encode CP864++                        "dosfarsi"      ->  encode DOSFarsi+                        "cp1006"        ->  encode CP1006++                        "asmo449"       ->  encode ASMO449++                        "isiri3342"     ->  encode ISIRI3342++                        _               ->  encode UTF
Parsek.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 531 $ $Date: 2008-04-11 00:55:45 +0200 (Fri, 11 Apr 2008) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  Parsek -- Copyright   :  Koen Claessen 2003 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --@@ -16,11 +12,7 @@ -- functional pearl article /Parallel Parsing Processes/, Journal of Functional -- Programming, 14(6), 741&#150;757, Cambridge University Press, 2004: ----- <http://www.cs.chalmers.se/~koen/pubs/entry-jfp04-parser.html>------ <http://www.cs.chalmers.se/Cs/Grundutb/Kurser/afp/>------ <http://www.cs.chalmers.se/Cs/Grundutb/Kurser/afp/code/week3/Parsek.hs>+-- <http://www.cse.chalmers.se/edu/course/afp/Papers/parser-claessen.pdf> -- -- --   Copyright (C) 2003  Koen Claessen
PureFP.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 1006 $ $Date: 2011-04-21 09:39:00 +0200 (Thu, 21 Apr 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  PureFP -- Copyright   :  Peter Ljunglof 2002 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
PureFP/OrdMap.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 262 $ $Date: 2007-04-12 12:19:50 +0200 (Thu, 12 Apr 2007) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  PureFP.OrdMap -- Copyright   :  Peter Ljunglof 2002 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
PureFP/OrdSet.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 262 $ $Date: 2007-04-12 12:19:50 +0200 (Thu, 12 Apr 2007) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  PureFP.OrdSet -- Copyright   :  Peter Ljunglof 2002 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
PureFP/Parsers.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 1006 $ $Date: 2011-04-21 09:39:00 +0200 (Thu, 21 Apr 2011) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  PureFP.Parsers -- Copyright   :  Peter Ljunglof 2002 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
PureFP/Parsers/AmbExTrie.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 262 $ $Date: 2007-04-12 12:19:50 +0200 (Thu, 12 Apr 2007) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  PureFP.Parsers.AmbExTrie -- Copyright   :  Peter Ljunglof 2002 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
PureFP/Parsers/AmbTrie.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 262 $ $Date: 2007-04-12 12:19:50 +0200 (Thu, 12 Apr 2007) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  PureFP.Parsers.AmbTrie -- Copyright   :  Peter Ljunglof 2002 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
PureFP/Parsers/ExTrie.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 262 $ $Date: 2007-04-12 12:19:50 +0200 (Thu, 12 Apr 2007) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  PureFP.Parsers.ExTrie -- Copyright   :  Peter Ljunglof 2002 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
PureFP/Parsers/PairTrie.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 262 $ $Date: 2007-04-12 12:19:50 +0200 (Thu, 12 Apr 2007) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  PureFP.Parsers.PairTrie -- Copyright   :  Peter Ljunglof 2002 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
PureFP/Parsers/Parser.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 262 $ $Date: 2007-04-12 12:19:50 +0200 (Thu, 12 Apr 2007) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  PureFP.Parsers.Parser -- Copyright   :  Peter Ljunglof 2002 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
PureFP/Parsers/Standard.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 287 $ $Date: 2007-04-25 23:25:57 +0200 (Wed, 25 Apr 2007) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  PureFP.Parsers.Standard -- Copyright   :  Peter Ljunglof 2002 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
PureFP/Parsers/Stream.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 264 $ $Date: 2007-04-13 18:24:56 +0200 (Fri, 13 Apr 2007) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  PureFP.Parsers.Stream -- Copyright   :  Peter Ljunglof 2002 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
PureFP/Parsers/Trie.hs view
@@ -1,14 +1,10 @@--- -----------------------------------------------------------------------------  $Revision: 262 $ $Date: 2007-04-12 12:19:50 +0200 (Thu, 12 Apr 2007) $--- --------------------------------------------------------------------------- -- | -- -- Module      :  PureFP.Parsers.Trie -- Copyright   :  Peter Ljunglof 2002 -- License     :  GPL ----- Maintainer  :  otakar.smrz mff.cuni.cz+-- Maintainer  :  otakar-smrz users.sf.net -- Stability   :  provisional -- Portability :  portable --
Setup.PL view
@@ -4,9 +4,7 @@ # # Building Encode ############################################################################## -# $Id: Setup.PL 1006 2011-04-21 07:39:00Z smrz $--our $VERSION = join '.', 1, 3, 5, q $Revision: 1006 $ =~ /(\d+)/;+our $VERSION = '1.3.6';   use File::Spec;