module Language.Drasil.NounPhrase.Combinators (
insertString, prependString, insertStringOp, insertStringGen,
the, theGen,
a_, a_Gen,
and_, and_PS, and_Gen, andThe,
ofThe, ofThePS, ofTheGen, inThe, inThePS, inTheGen,
the_ofThe, the_ofThePS, the_ofTheGen,
for, forPS, forGen,
of_, of_PS, of_Gen,
with, parensNP,
NPStruct((:+:), S, P)
) where
import Language.Drasil.NounPhrase
( NP,
CapitalizationRule(CapWords, CapFirst, CapNothing),
NounPhrase(phraseNP, pluralNP),
nounPhrase'', surroundNPStruct)
import Language.Drasil.NounPhrase.Core (NPStruct((:+:),S,P))
insertString :: String -> NP -> NP -> NP
insertString :: String -> NP -> NP -> NP
insertString String
s NP
t1 NP
t2 = NPStruct
-> NPStruct -> CapitalizationRule -> CapitalizationRule -> NP
nounPhrase'' (NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP NP
t1 NPStruct -> NPStruct -> NPStruct
:+: String -> NPStruct
S String
s NPStruct -> NPStruct -> NPStruct
:+: NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP NP
t2) (NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP NP
t1 NPStruct -> NPStruct -> NPStruct
:+: String -> NPStruct
S String
s NPStruct -> NPStruct -> NPStruct
:+: NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
pluralNP NP
t2) CapitalizationRule
CapFirst CapitalizationRule
CapWords
insertStringOp :: String -> NP -> NP -> NP
insertStringOp :: String -> NP -> NP -> NP
insertStringOp String
s NP
t1 NP
t2 = NPStruct
-> NPStruct -> CapitalizationRule -> CapitalizationRule -> NP
nounPhrase'' (NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP NP
t1 NPStruct -> NPStruct -> NPStruct
:+: String -> NPStruct
S String
s NPStruct -> NPStruct -> NPStruct
:+: NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP NP
t2) (NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
pluralNP NP
t1 NPStruct -> NPStruct -> NPStruct
:+: String -> NPStruct
S String
s NPStruct -> NPStruct -> NPStruct
:+: NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP NP
t2) CapitalizationRule
CapFirst CapitalizationRule
CapWords
insertStringGen :: String -> (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
insertStringGen :: String -> (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
insertStringGen String
s NP -> NPStruct
f1 NP -> NPStruct
f2 NP
t1 NP
t2 = NPStruct
-> NPStruct -> CapitalizationRule -> CapitalizationRule -> NP
nounPhrase'' (NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP NP
t1 NPStruct -> NPStruct -> NPStruct
:+: String -> NPStruct
S String
s NPStruct -> NPStruct -> NPStruct
:+: NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP NP
t2) (NP -> NPStruct
f1 NP
t1 NPStruct -> NPStruct -> NPStruct
:+: String -> NPStruct
S String
s NPStruct -> NPStruct -> NPStruct
:+: NP -> NPStruct
f2 NP
t2) CapitalizationRule
CapFirst CapitalizationRule
CapWords
prependString :: String -> NP -> NP
prependString :: String -> NP -> NP
prependString String
s NP
t1 = NPStruct
-> NPStruct -> CapitalizationRule -> CapitalizationRule -> NP
nounPhrase'' (String -> NPStruct
S String
s NPStruct -> NPStruct -> NPStruct
:+: NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP NP
t1) (String -> NPStruct
S String
s NPStruct -> NPStruct -> NPStruct
:+: NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
pluralNP NP
t1) CapitalizationRule
CapFirst CapitalizationRule
CapWords
prependStringGen :: String -> (NP -> NPStruct) -> NP -> NP
prependStringGen :: String -> (NP -> NPStruct) -> NP -> NP
prependStringGen String
s NP -> NPStruct
f NP
t = NPStruct
-> NPStruct -> CapitalizationRule -> CapitalizationRule -> NP
nounPhrase'' (String -> NPStruct
S String
s NPStruct -> NPStruct -> NPStruct
:+: NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP NP
t) (String -> NPStruct
S String
s NPStruct -> NPStruct -> NPStruct
:+: NP -> NPStruct
f NP
t) CapitalizationRule
CapFirst CapitalizationRule
CapWords
surround :: String -> String -> NP -> NP
surround :: String -> String -> NP -> NP
surround String
l String
r NP
t = NPStruct
-> NPStruct -> CapitalizationRule -> CapitalizationRule -> NP
nounPhrase'' (String -> String -> NPStruct -> NPStruct
surroundNPStruct String
l String
r (NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP NP
t)) (String -> String -> NPStruct -> NPStruct
surroundNPStruct String
l String
r (NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
pluralNP NP
t)) CapitalizationRule
CapNothing CapitalizationRule
CapNothing
the :: NP -> NP
the :: NP -> NP
the = String -> NP -> NP
prependString String
"the"
theGen :: (NP -> NPStruct) -> NP -> NP
theGen :: (NP -> NPStruct) -> NP -> NP
theGen = String -> (NP -> NPStruct) -> NP -> NP
prependStringGen String
"the"
a_ :: NP -> NP
a_ :: NP -> NP
a_ = String -> NP -> NP
prependString String
"a"
a_Gen :: (NP -> NPStruct) -> NP -> NP
a_Gen :: (NP -> NPStruct) -> NP -> NP
a_Gen = String -> (NP -> NPStruct) -> NP -> NP
prependStringGen String
"a"
ofThe :: NP -> NP -> NP
ofThe :: NP -> NP -> NP
ofThe = String -> NP -> NP -> NP
insertString String
"of the"
ofThePS :: NP -> NP -> NP
ofThePS :: NP -> NP -> NP
ofThePS = String -> NP -> NP -> NP
insertStringOp String
"of the"
ofTheGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
ofTheGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
ofTheGen = String -> (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
insertStringGen String
"of the"
inThe :: NP -> NP -> NP
inThe :: NP -> NP -> NP
inThe = String -> NP -> NP -> NP
insertString String
"in the"
inThePS :: NP -> NP -> NP
inThePS :: NP -> NP -> NP
inThePS = String -> NP -> NP -> NP
insertStringOp String
"in the"
inTheGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
inTheGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
inTheGen = String -> (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
insertStringGen String
"in the"
the_ofThe :: NP -> NP -> NP
the_ofThe :: NP -> NP -> NP
the_ofThe NP
t1 NP
t2 = NP -> NP
the NP
t1 NP -> NP -> NP
`ofThe` NP
t2
the_ofThePS :: NP -> NP -> NP
the_ofThePS :: NP -> NP -> NP
the_ofThePS NP
t1 NP
t2 = NP -> NP
the NP
t1 NP -> NP -> NP
`ofThePS` NP
t2
the_ofTheGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
the_ofTheGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
the_ofTheGen NP -> NPStruct
f1 NP -> NPStruct
f2 NP
t1 = (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
ofTheGen NP -> NPStruct
f1 NP -> NPStruct
f2 (NP -> NP
the NP
t1)
for :: NP -> NP -> NP
for :: NP -> NP -> NP
for = String -> NP -> NP -> NP
insertString String
"for"
forPS :: NP -> NP -> NP
forPS :: NP -> NP -> NP
forPS = String -> NP -> NP -> NP
insertStringOp String
"for"
forGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
forGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
forGen = String -> (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
insertStringGen String
"for"
of_ :: NP -> NP -> NP
of_ :: NP -> NP -> NP
of_ = String -> NP -> NP -> NP
insertString String
"of"
of_PS :: NP -> NP -> NP
of_PS :: NP -> NP -> NP
of_PS = String -> NP -> NP -> NP
insertStringOp String
"of"
of_Gen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
of_Gen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
of_Gen = String -> (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
insertStringGen String
"of"
with :: NP -> NP -> NP
with :: NP -> NP -> NP
with = String -> NP -> NP -> NP
insertString String
"with"
and_ :: NP -> NP -> NP
and_ :: NP -> NP -> NP
and_ = String -> NP -> NP -> NP
insertString String
"and"
and_PS :: NP -> NP -> NP
and_PS :: NP -> NP -> NP
and_PS = String -> NP -> NP -> NP
insertStringOp String
"and"
and_Gen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
and_Gen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
and_Gen = String -> (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
insertStringGen String
"and"
andThe :: NP -> NP -> NP
andThe :: NP -> NP -> NP
andThe = String -> NP -> NP -> NP
insertString String
"and the"
parensNP :: NP -> NP
parensNP :: NP -> NP
parensNP = String -> String -> NP -> NP
surround String
"(" String
")"