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 @@ ...@@ -2,6 +2,8 @@
module Text.Encyclopedia.Article ( module Text.Encyclopedia.Article (
Article(..) Article(..)
, InflectedPOS(..) , InflectedPOS(..)
, Inflection(..)
, POS(..)
, article , article
, headwords_ , headwords_
, inflectedPOS_ , inflectedPOS_
...@@ -18,19 +20,19 @@ import Data.Char (isLower, isPunctuation, isSpace, isUpper, toLower) ...@@ -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 Data.Text as Text (Text, append, isPrefixOf, length, map, pack, splitAt, unpack)
import Text.Printf (printf) import Text.Printf (printf)
data POS = Adj | Substantive | Verb deriving (Bounded, Enum, Show) data POS = Adjective | Substantive | Verb deriving (Bounded, Enum, Eq, Show)
data Inflection = Masculine | Feminine deriving (Bounded, Enum, Show) data Inflection = Masculine | Feminine deriving (Bounded, Enum, Eq, Show)
data InflectedPOS = InflectedPOS { data InflectedPOS = InflectedPOS {
pos :: POS pos :: POS
, inflection :: Maybe Inflection , inflection :: Maybe Inflection
} deriving Show } deriving (Eq, Show)
data Article = Article { data Article = Article {
headwords :: [String] headwords :: [String]
, inflectedPOS :: Maybe InflectedPOS , inflectedPOS :: Maybe InflectedPOS
, body :: Text , body :: Text
} deriving Show } deriving (Eq, Show)
article :: Parser Article article :: Parser Article
article = Article <$> headwords_ <*> optional inflectedPOS_ <*> body_ 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