summaryrefslogtreecommitdiff
path: root/src/GF/Text/ExtraDiacritics.hs
blob: f9e484b598f51188c4c1613eedfd93e2636fe6c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
----------------------------------------------------------------------
-- |
-- Module      : ExtraDiacritics
-- Maintainer  : (Maintainer)
-- Stability   : (stable)
-- Portability : (portable)
--
-- > CVS $Date: 2005/02/18 19:21:14 $ 
-- > CVS $Author: peb $
-- > CVS $Revision: 1.4 $
--
-- (Description of the module)
-----------------------------------------------------------------------------

module ExtraDiacritics (mkExtraDiacritics) where

mkExtraDiacritics :: String -> String
mkExtraDiacritics = mkExtraDiacriticsWord

mkExtraDiacriticsWord :: String -> String
mkExtraDiacriticsWord str = case str of
  [] -> []
  '<' : cs -> '<' : spoolMarkup cs
  -- 
  '/' : cs -> toEnum 0x0301 : mkExtraDiacriticsWord cs
  '~' : cs -> toEnum 0x0306 : mkExtraDiacriticsWord cs
  ':' : cs -> toEnum 0x0304 : mkExtraDiacriticsWord cs -- some of these could be put in LatinA
  '.' : cs -> toEnum 0x0323 : mkExtraDiacriticsWord cs
  'i' : '-' : cs -> toEnum 0x0268 : mkExtraDiacriticsWord cs -- in IPA extensions
  -- Default 
  c : cs -> c : mkExtraDiacriticsWord cs

spoolMarkup :: String -> String
spoolMarkup s = case s of
   [] -> [] -- Shouldn't happen
   '>' : cs -> '>' : mkExtraDiacriticsWord cs
   c1 : cs -> c1 : spoolMarkup cs