Skip to content
Snippets Groups Projects
Commit aa302481 authored by Alice Brenon's avatar Alice Brenon
Browse files

Publish constructors necessary for matching and, immediately, tests

parent b282bde7
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,8 @@
module Text.Encyclopedia.Article (
Article(..)
, InflectedPOS(..)
, Inflection(..)
, POS(..)
, article
, headwords_
, inflectedPOS_
......@@ -18,19 +20,19 @@ import Data.Char (isLower, isPunctuation, isSpace, isUpper, toLower)
import Data.Text as Text (Text, append, isPrefixOf, length, map, pack, splitAt, unpack)
import Text.Printf (printf)
data POS = Adj | Substantive | Verb deriving (Bounded, Enum, Show)
data Inflection = Masculine | Feminine deriving (Bounded, Enum, Show)
data POS = Adjective | Substantive | Verb deriving (Bounded, Enum, Eq, Show)
data Inflection = Masculine | Feminine deriving (Bounded, Enum, Eq, Show)
data InflectedPOS = InflectedPOS {
pos :: POS
, inflection :: Maybe Inflection
} deriving Show
} deriving (Eq, Show)
data Article = Article {
headwords :: [String]
, inflectedPOS :: Maybe InflectedPOS
, body :: Text
} deriving Show
} deriving (Eq, Show)
article :: Parser Article
article = Article <$> headwords_ <*> optional inflectedPOS_ <*> body_
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment