| 1 |
{- |
| 2 |
- Language/Ding/Enrich/Grammar/FromInflectedForms.hs - Recognize that inflec- |
| 3 |
- ted forms are only |
| 4 |
- annotated to verbs. |
| 5 |
- |
| 6 |
- Copyright 2020 Einhard Leichtfuß |
| 7 |
- |
| 8 |
- This file is part of ding2tei-haskell. |
| 9 |
- |
| 10 |
- ding2tei-haskell is free software: you can redistribute it and/or modify |
| 11 |
- it under the terms of the GNU Affero General Public License as published |
| 12 |
- by the Free Software Foundation, either version 3 of the License, or |
| 13 |
- (at your option) any later version. |
| 14 |
- |
| 15 |
- ding2tei-haskell is distributed in the hope that it will be useful, |
| 16 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 |
- GNU Affero General Public License for more details. |
| 19 |
- |
| 20 |
- You should have received a copy of the GNU Affero General Public License |
| 21 |
- along with ding2tei-haskell. If not, see <https://www.gnu.org/licenses/>. |
| 22 |
-} |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
module Language.Ding.Enrich.Grammar.InflectedForms |
| 36 |
( enrichFromInflectedForms |
| 37 |
) where |
| 38 |
|
| 39 |
import Data.NatLang.Grammar |
| 40 |
( GrammarInfo(GramLexCategory) |
| 41 |
, GramLexCategory(PartOfSpeech) |
| 42 |
, PartOfSpeech(Verb) |
| 43 |
) |
| 44 |
import Language.Ding.Syntax (Unit(unitInflected, unitGrammar)) |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
enrichFromInflectedForms :: Unit -> Unit |
| 51 |
enrichFromInflectedForms u = |
| 52 |
case unitInflected u of |
| 53 |
(Just _) -> u { unitGrammar = unitGrammar u ++ verbAnnot : [] } |
| 54 |
Nothing -> u |
| 55 |
where |
| 56 |
verbAnnot = GramLexCategory $ PartOfSpeech $ Verb [] |
| 57 |
|
| 58 |
|
| 59 |
-- vi: ft=haskell ts=2 sw=2 et |