| 1 |
{- |
| 2 |
- Language/TEI/Syntax.hs - general AST structures |
| 3 |
- |
| 4 |
- Copyright 2020,2022 Einhard Leichtfuß |
| 5 |
- |
| 6 |
- This file is part of ding2tei-haskell. |
| 7 |
- |
| 8 |
- ding2tei-haskell is free software: you can redistribute it and/or modify |
| 9 |
- it under the terms of the GNU Affero General Public License as published |
| 10 |
- by the Free Software Foundation, either version 3 of the License, or |
| 11 |
- (at your option) any later version. |
| 12 |
- |
| 13 |
- ding2tei-haskell is distributed in the hope that it will be useful, |
| 14 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
- GNU Affero General Public License for more details. |
| 17 |
- |
| 18 |
- You should have received a copy of the GNU Affero General Public License |
| 19 |
- along with ding2tei-haskell. If not, see <https://www.gnu.org/licenses/>. |
| 20 |
-} |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
module Language.TEI.Syntax |
| 39 |
( TEI |
| 40 |
, Entry(..) |
| 41 |
, Form(..) |
| 42 |
, Sense(..) |
| 43 |
, Translation(..) |
| 44 |
) where |
| 45 |
|
| 46 |
import Data.NatLang.Dictionary (Dictionary) |
| 47 |
import Data.NatLang.Grammar (GrammarInfo) |
| 48 |
import Data.NatLang.Usage (Usage) |
| 49 |
import Data.NatLang.InflectedForms (InflectedForms) |
| 50 |
import qualified Language.Ding.Syntax as Ding (Header) |
| 51 |
import Language.TEI.Syntax.Reference (Ident, ReferenceGroup) |
| 52 |
import Data.NatLang.Example (Example) |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
type TEI = Dictionary Ding.Header Entry |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
data Entry = Entry |
| 64 |
{ entryIdent :: Ident |
| 65 |
, entryForm :: Form |
| 66 |
, entryGrammar :: [GrammarInfo] |
| 67 |
, entrySenses :: [Sense] |
| 68 |
} |
| 69 |
deriving Show |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
data Form = Form |
| 76 |
{ formOrth :: String |
| 77 |
, formAbbrevs :: [String] |
| 78 |
, formInflected :: Maybe InflectedForms |
| 79 |
} |
| 80 |
deriving (Show, Eq, Ord) |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
data Sense = Sense |
| 85 |
{ senseGrammar :: [GrammarInfo] |
| 86 |
, senseUsages :: [Usage] |
| 87 |
, senseTranslations :: [Translation] |
| 88 |
, senseExamples :: [Example] |
| 89 |
, senseReferences :: [ReferenceGroup] |
| 90 |
|
| 91 |
-- No two reference groups with the same type should occur. |
| 92 |
, senseNotes :: [String] |
| 93 |
} |
| 94 |
deriving (Show, Eq, Ord) |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
data Translation = Translation |
| 100 |
{ translationOrth :: String |
| 101 |
, translationGrammar :: [GrammarInfo] |
| 102 |
, translationUsages :: [Usage] |
| 103 |
, translationAbbrevs :: [String] |
| 104 |
, translationInflected :: Maybe InflectedForms |
| 105 |
, translationNotes :: [String] |
| 106 |
} |
| 107 |
deriving (Show, Eq, Ord) |
| 108 |
|
| 109 |
|
| 110 |
-- vi: ft=haskell ts=2 sw=2 et |