phonetic-languages-simplified-generalized-examples-array 0.4.1.1 → 0.4.2.0
raw patch · 3 files changed
+48/−16 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ EspeakNG_IPA: espeakNG_IPA1 :: String -> String -> IO String
+ EspeakNG_IPA: espeakNG_IPA1_ :: String -> String -> IO ()
+ EspeakNG_IPA: espeakNG_IPA_G :: (String -> String) -> String -> String -> IO String
+ EspeakNG_IPA: espeakNG_IPA_G_ :: (String -> String) -> String -> String -> IO ()
Files
- ChangeLog.md +4/−0
- EspeakNG_IPA.hs +43/−15
- phonetic-languages-simplified-generalized-examples-array.cabal +1/−1
ChangeLog.md view
@@ -42,3 +42,7 @@ ## 0.4.1.1 -- 2021-07-06 * Fourth version revised B. Fixed spelling and stylistic issues in the documentation. ++## 0.4.2.0 -- 2021-07-08++* Fourth version revised C. Added filtering possibilities and two generalized functions to the EspeakNG_IPA module.
EspeakNG_IPA.hs view
@@ -20,31 +20,59 @@ {-| Given a language 'String' supported by the espeak-ng or espeak (which one is installed properly, the espeak-ng is a preferred one) and the needed text returns the IPA representation. Is just some wrapper around the espeak functionality. -} espeakNG_IPA :: String -> String -> IO String-espeakNG_IPA voice xs =+espeakNG_IPA = espeakNG_IPA_G id+{-# INLINE espeakNG_IPA #-}++{-| Given a language 'String' supported by the espeak-ng or espeak (which one is installed properly, the espeak-ng+is a preferred one) and the needed text returns the IPA representation filtered of the \'ˈ\' and \':\' characters.+Is just some wrapper around the espeak functionality. -}+espeakNG_IPA1 :: String -> String -> IO String+espeakNG_IPA1 = espeakNG_IPA_G (filter (\x -> x /= 'ˈ' && x /= ':'))+{-# INLINE espeakNG_IPA1 #-}++{-| Given a language 'String' supported by the espeak-ng or espeak (which one is installed properly, the espeak-ng+is a preferred one) and the needed text prints the IPA representation. Is just some wrapper around the espeak functionality. -} +espeakNG_IPA_ :: String -> String -> IO ()+espeakNG_IPA_ = espeakNG_IPA_G_ id+{-# INLINE espeakNG_IPA_ #-}++{-| Given a language 'String' supported by the espeak-ng or espeak (which one is installed properly, the espeak-ng+is a preferred one) and the needed text prints the IPA representation filtered of the \'ˈ\' and \':\' characters.+Is just some wrapper around the espeak functionality. -} +espeakNG_IPA1_ :: String -> String -> IO ()+espeakNG_IPA1_ = espeakNG_IPA_G_ (filter (\x -> x /= 'ˈ' && x /= ':'))+{-# INLINE espeakNG_IPA1_ #-}++{-| Given a conversion function that is applied to the resulting 'String' before it is returned, a language+'String' supported by the espeak-ng or espeak (which one is installed properly, the espeak-ng+is a preferred one) and the needed text returns the IPA representation. Is just some wrapper around the espeak functionality. -}+espeakNG_IPA_G :: (String -> String) -> String -> String -> IO String+espeakNG_IPA_G g voice xs = case showE "espeak-ng" of Just path -> readProcessWithExitCode path ("-xq":"--ipa":"-v":[voice]) xs >>= \(hcode,hout,herr) -> case hcode of- ExitSuccess -> return (unwords . lines $ hout)- _ -> error ("EspeakNG_IPA.espeakNG_IPA: " ++ show herr)+ ExitSuccess -> return (g . unwords . lines $ hout)+ _ -> error ("EspeakNG_IPA.espeakNG_IPA_G: " ++ show herr) _ -> case showE "espeak" of Just path2 -> readProcessWithExitCode path2 ("-xq":"--ipa":"-v":[voice]) xs >>= \(hcode,hout,herr) -> case hcode of- ExitSuccess -> return (unwords . lines $ hout)- _ -> error ("EspeakNG_IPA.espeakNG_IPA: " ++ show herr)- _ -> error ("EspeakNG_IPA.espeakNG_IPA: No espeak or espeak-ng executable is installed in the PATH directories. ")+ ExitSuccess -> return (g . unwords . lines $ hout)+ _ -> error ("EspeakNG_IPA.espeakNG_IPA_G: " ++ show herr)+ _ -> error ("EspeakNG_IPA.espeakNG_IPA_G: No espeak or espeak-ng executable is installed in the PATH directories. ") -{-| Given a language 'String' supported by the espeak-ng or espeak (which one is installed properly, the espeak-ng-is a preferred one) and the needed text prints the IPA representation. Is just some wrapper around the espeak functionality. -} -espeakNG_IPA_ :: String -> String -> IO ()-espeakNG_IPA_ voice xs =+{-| Given a conversion function that is applied to the resulting 'String' before it is printed, a language+'String' supported by the espeak-ng or espeak (which one is installed properly, the espeak-ng+is a preferred one) and the needed text prints the IPA representation. Is just some wrapper around the espeak functionality. -}+espeakNG_IPA_G_ :: (String -> String) -> String -> String -> IO ()+espeakNG_IPA_G_ g voice xs = case showE "espeak-ng" of Just path -> readProcessWithExitCode path ("-xq":"--ipa":"-v":[voice]) xs >>= \(hcode,hout,herr) -> case hcode of- ExitSuccess -> putStrLn (unwords . lines $ hout)- _ -> error ("EspeakNG_IPA.espeakNG_IPA_: " ++ show herr)+ ExitSuccess -> putStrLn (g . unwords . lines $ hout)+ _ -> error ("EspeakNG_IPA.espeakNG_IPA_G_: " ++ show herr) _ -> case showE "espeak" of Just path2 -> readProcessWithExitCode path2 ("-xq":"--ipa":"-v":[voice]) xs >>= \(hcode,hout,herr) -> case hcode of- ExitSuccess -> putStrLn (unwords . lines $ hout)- _ -> error ("EspeakNG_IPA.espeakNG_IPA_: " ++ show herr)- _ -> error ("EspeakNG_IPA.espeakNG_IPA_: No espeak or espeak-ng executable is installed in the PATH directories. ")+ ExitSuccess -> putStrLn (g . unwords . lines $ hout)+ _ -> error ("EspeakNG_IPA.espeakNG_IPA_G_: " ++ show herr)+ _ -> error ("EspeakNG_IPA.espeakNG_IPA_G_: No espeak or espeak-ng executable is installed in the PATH directories. ")
phonetic-languages-simplified-generalized-examples-array.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/ name: phonetic-languages-simplified-generalized-examples-array-version: 0.4.1.1+version: 0.4.2.0 synopsis: Helps to create texts with the given phonetic properties (e. g. poetic). description: Is rewritten from the modules of the @phonetic-languages-simplified-examples-array@ package. Can be used not only for Ukrainian, but also for other languages. homepage: https://hackage.haskell.org/package/phonetic-languages-simplified-generalized-examples-array