module Text.Numeral.Grammar
(
Inflection(..)
, defaultInflection
, Case(..)
, Gender(..)
, Number(..)
, noCase, hasNoCase
, ablative, isAblative
, abessive, isAbessive
, accusative, isAccusative
, comitative, isComitative
, dative, isDative
, delative, isDelative
, distributive, isDistributive
, distributiveTemporal, isDistributiveTemporal
, essive, isEssive
, genitive, isGenitive
, instrumental, isInstrumental
, instructive, isInstructive
, lative, isLative
, locative, isLocative
, multiplicative, isMultiplicative
, nominative, isNominative
, partitive, isPartitive
, superEssive, isSuperEssive
, sublative, isSublative
, translative, isTranslative
, vocative, isVocative
, locativeInessive, isLocativeInessive
, locativeElative, isLocativeElative
, locativeIllative, isLocativeIllative
, locativeAdessive, isLocativeAdessive
, locativeAblative, isLocativeAblative
, locativeAllative, isLocativeAllative
, noGender, hasNoGender
, neuter, isNeuter
, masculine, isMasculine
, feminine, isFeminine
, common, isCommon
, noNumber, hasNoNumber
, singular, isSingular
, dual, isDual
, trial, isTrial
, paucal, isPaucal
, plural, isPlural
) where
data Inflection
= Inflection
{ iCase :: Maybe Case
, iGender :: Maybe Gender
, iNumber :: Maybe Number
} deriving (Show, Eq)
defaultInflection :: Inflection
defaultInflection = Inflection Nothing Nothing Nothing
data Case
= Abessive
| Ablative
| Accusative
| Comitative
| Dative
| Delative
| Distributive
| DistributiveTemporal
| Essive
| Genitive
| Instrumental
| Instructive
| Lative
| Locative (Maybe Locative)
| Multiplicative
| Nominative
| Partitive
| Sublative
| SuperEssive
| Translative
| Vocative
deriving (Eq, Show)
data Locative
= LocativeIllative
| LocativeInessive
| LocativeElative
| LocativeAllative
| LocativeAdessive
| LocativeAblative
deriving (Eq, Show)
data Gender
= Neuter
| Masculine
| Feminine
| Common
deriving (Eq, Show)
data Number
= Singular
| Dual
| Trial
| Paucal
| Plural
deriving (Eq, Show)
noCase :: Inflection -> Inflection
noCase inf = inf { iCase = Nothing }
hasNoCase :: Inflection -> Bool
hasNoCase (Inflection {iCase}) = iCase == Nothing
ablative :: Inflection -> Inflection
ablative inf = inf { iCase = Just Ablative }
isAblative :: Inflection -> Bool
isAblative (Inflection {iCase}) = iCase == Just Ablative
abessive :: Inflection -> Inflection
abessive inf = inf { iCase = Just Abessive }
isAbessive :: Inflection -> Bool
isAbessive (Inflection {iCase}) = iCase == Just Abessive
accusative :: Inflection -> Inflection
accusative inf = inf { iCase = Just Accusative }
isAccusative :: Inflection -> Bool
isAccusative (Inflection {iCase}) = iCase == Just Accusative
comitative :: Inflection -> Inflection
comitative inf = inf { iCase = Just Comitative }
isComitative :: Inflection -> Bool
isComitative (Inflection {iCase}) = iCase == Just Comitative
dative :: Inflection -> Inflection
dative inf = inf { iCase = Just Dative }
isDative :: Inflection -> Bool
isDative (Inflection {iCase}) = iCase == Just Dative
delative :: Inflection -> Inflection
delative inf = inf { iCase = Just Delative }
isDelative :: Inflection -> Bool
isDelative (Inflection {iCase}) = iCase == Just Delative
distributive :: Inflection -> Inflection
distributive inf = inf { iCase = Just Distributive }
isDistributive :: Inflection -> Bool
isDistributive (Inflection {iCase}) = iCase == Just Distributive
distributiveTemporal :: Inflection -> Inflection
distributiveTemporal inf = inf { iCase = Just DistributiveTemporal }
isDistributiveTemporal :: Inflection -> Bool
isDistributiveTemporal (Inflection {iCase}) = iCase == Just DistributiveTemporal
essive :: Inflection -> Inflection
essive inf = inf { iCase = Just Essive }
isEssive :: Inflection -> Bool
isEssive (Inflection {iCase}) = iCase == Just Essive
genitive :: Inflection -> Inflection
genitive inf = inf { iCase = Just Genitive }
isGenitive :: Inflection -> Bool
isGenitive (Inflection {iCase}) = iCase == Just Genitive
instrumental :: Inflection -> Inflection
instrumental inf = inf { iCase = Just Instrumental }
isInstrumental :: Inflection -> Bool
isInstrumental (Inflection {iCase}) = iCase == Just Instrumental
instructive :: Inflection -> Inflection
instructive inf = inf { iCase = Just Instructive }
isInstructive :: Inflection -> Bool
isInstructive (Inflection {iCase}) = iCase == Just Instructive
lative :: Inflection -> Inflection
lative inf = inf { iCase = Just Lative }
isLative :: Inflection -> Bool
isLative (Inflection {iCase}) = iCase == Just Lative
locative :: Inflection -> Inflection
locative inf = inf { iCase = Just (Locative Nothing) }
isLocative :: Inflection -> Bool
isLocative (Inflection {iCase}) =
case iCase of
Just (Locative _) -> True
_ -> False
multiplicative :: Inflection -> Inflection
multiplicative inf = inf { iCase = Just Multiplicative }
isMultiplicative :: Inflection -> Bool
isMultiplicative (Inflection {iCase}) = iCase == Just Multiplicative
nominative :: Inflection -> Inflection
nominative inf = inf { iCase = Just Nominative }
isNominative :: Inflection -> Bool
isNominative (Inflection {iCase}) = iCase == Just Nominative
partitive :: Inflection -> Inflection
partitive inf = inf { iCase = Just Partitive }
isPartitive :: Inflection -> Bool
isPartitive (Inflection {iCase}) = iCase == Just Partitive
superEssive :: Inflection -> Inflection
superEssive inf = inf { iCase = Just SuperEssive }
isSuperEssive :: Inflection -> Bool
isSuperEssive (Inflection {iCase}) = iCase == Just SuperEssive
sublative :: Inflection -> Inflection
sublative inf = inf { iCase = Just Sublative }
isSublative :: Inflection -> Bool
isSublative (Inflection {iCase}) = iCase == Just Sublative
translative :: Inflection -> Inflection
translative inf = inf { iCase = Just Translative }
isTranslative :: Inflection -> Bool
isTranslative (Inflection {iCase}) = iCase == Just Translative
vocative :: Inflection -> Inflection
vocative inf = inf { iCase = Just Vocative }
isVocative :: Inflection -> Bool
isVocative (Inflection {iCase}) = iCase == Just Vocative
locativeInessive :: Inflection -> Inflection
locativeInessive inf = inf {iCase = Just $ Locative $ Just LocativeInessive}
isLocativeInessive :: Inflection -> Bool
isLocativeInessive (Inflection {iCase}) =
iCase == (Just $ Locative $ Just LocativeInessive)
locativeElative :: Inflection -> Inflection
locativeElative inf = inf {iCase = Just $ Locative $ Just LocativeElative}
isLocativeElative :: Inflection -> Bool
isLocativeElative (Inflection {iCase}) =
iCase == (Just $ Locative $ Just LocativeElative)
locativeIllative :: Inflection -> Inflection
locativeIllative inf = inf {iCase = Just $ Locative $ Just LocativeIllative}
isLocativeIllative :: Inflection -> Bool
isLocativeIllative (Inflection {iCase}) =
iCase == (Just $ Locative $ Just LocativeIllative)
locativeAdessive :: Inflection -> Inflection
locativeAdessive inf = inf {iCase = Just $ Locative $ Just LocativeAdessive}
isLocativeAdessive :: Inflection -> Bool
isLocativeAdessive (Inflection {iCase}) =
iCase == (Just $ Locative $ Just LocativeAdessive)
locativeAblative :: Inflection -> Inflection
locativeAblative inf = inf {iCase = Just $ Locative $ Just LocativeAblative}
isLocativeAblative :: Inflection -> Bool
isLocativeAblative (Inflection {iCase}) =
iCase == (Just $ Locative $ Just LocativeAblative)
locativeAllative :: Inflection -> Inflection
locativeAllative inf = inf {iCase = Just $ Locative $ Just LocativeAllative}
isLocativeAllative :: Inflection -> Bool
isLocativeAllative (Inflection {iCase}) =
iCase == (Just $ Locative $ Just LocativeAllative)
noGender :: Inflection -> Inflection
noGender inf = inf { iGender = Nothing }
hasNoGender :: Inflection -> Bool
hasNoGender (Inflection {iGender}) = iGender == Nothing
neuter :: Inflection -> Inflection
neuter inf = inf { iGender = Just Neuter }
isNeuter :: Inflection -> Bool
isNeuter (Inflection {iGender}) = iGender == Just Neuter
masculine :: Inflection -> Inflection
masculine inf = inf { iGender = Just Masculine }
isMasculine :: Inflection -> Bool
isMasculine (Inflection {iGender}) = iGender == Just Masculine
feminine :: Inflection -> Inflection
feminine inf = inf { iGender = Just Feminine }
isFeminine :: Inflection -> Bool
isFeminine (Inflection {iGender}) = iGender == Just Feminine
common :: Inflection -> Inflection
common inf = inf { iGender = Just Common }
isCommon :: Inflection -> Bool
isCommon (Inflection {iGender}) = iGender == Just Common
noNumber :: Inflection -> Inflection
noNumber inf = inf { iNumber = Nothing }
hasNoNumber :: Inflection -> Bool
hasNoNumber (Inflection {iNumber}) = iNumber == Nothing
singular :: Inflection -> Inflection
singular inf = inf { iNumber = Just Singular }
isSingular :: Inflection -> Bool
isSingular (Inflection {iNumber}) = iNumber == Just Singular
dual :: Inflection -> Inflection
dual inf = inf { iNumber = Just Dual }
isDual :: Inflection -> Bool
isDual (Inflection {iNumber}) = iNumber == Just Dual
trial :: Inflection -> Inflection
trial inf = inf { iNumber = Just Trial }
isTrial :: Inflection -> Bool
isTrial (Inflection {iNumber}) = iNumber == Just Trial
paucal :: Inflection -> Inflection
paucal inf = inf { iNumber = Just Paucal }
isPaucal :: Inflection -> Bool
isPaucal (Inflection {iNumber}) = iNumber == Just Paucal
plural :: Inflection -> Inflection
plural inf = inf { iNumber = Just Plural }
isPlural :: Inflection -> Bool
isPlural (Inflection {iNumber}) = iNumber == Just Plural