| 1 |
{- |
| 2 |
- Data/NatLang/Usage.hs - usage information |
| 3 |
- |
| 4 |
- Copyright 2020 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 |
module Data.NatLang.Usage |
| 26 |
( Usage(..) |
| 27 |
, UsageType(..) |
| 28 |
) where |
| 29 |
|
| 30 |
-- Notes: |
| 31 |
-- * In the Ding, usages are represented within <[]>. |
| 32 |
-- * In TEI, usages are represented in <usg> tags. |
| 33 |
-- * See the TEI doc on <usg>. |
| 34 |
-- * https://www.tei-c.org/release/doc/tei-p5-doc/en/html/DI.html#DITPUS |
| 35 |
-- * See also the TEI Lex-0 documentation on <usg>. |
| 36 |
-- * https://dariah-eric.github.io/lexicalresources/pages/TEILex0/TEILex0.html#index.xml-body.1_div.7_div.2 |
| 37 |
-- * See also the Wikipedia on Varieties and Registers (contains a list). |
| 38 |
-- * https://en.wikipedia.org/wiki/Variety_(linguistics) |
| 39 |
-- * https://en.wikipedia.org/wiki/Register_(sociolinguistics) |
| 40 |
|
| 41 |
|
| 42 |
data Usage = Usage UsageType String |
| 43 |
deriving (Show, Eq, Ord) |
| 44 |
|
| 45 |
-- Maps directly to TEI recommended \@type values for <usg>. |
| 46 |
-- | Usage types. |
| 47 |
-- These map directly to the TEI Guidelines' recommended \@type value for |
| 48 |
-- <usg>. Some unused types are omitted. |
| 49 |
-- See: <https://www.tei-c.org/release/doc/tei-p5-doc/en/html/DI.html#DITPUS> |
| 50 |
data UsageType |
| 51 |
= Regional |
| 52 |
| Time |
| 53 |
| Domain |
| 54 |
| Register |
| 55 |
| Style |
| 56 |
| Preference |
| 57 |
| Acceptability -- likely unused; consider to remove |
| 58 |
| Language -- @type="lang" - do not confound with @xml:lang ! |
| 59 |
| Colloc |
| 60 |
| Hint |
| 61 |
deriving (Eq, Ord) |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
instance Show UsageType where |
| 66 |
show Regional = "geo" |
| 67 |
show Time = "time" |
| 68 |
show Domain = "dom" |
| 69 |
show Register = "reg" |
| 70 |
show Style = "style" |
| 71 |
show Preference = "plev" |
| 72 |
show Acceptability = "acc" |
| 73 |
show Language = "lang" |
| 74 |
show Colloc = "colloc" |
| 75 |
show Hint = "hint" |
| 76 |
|
| 77 |
|
| 78 |
-- vi: ts=2 sw=2 et |