| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Language.Drasil.Chunk.Concept.NamedCombinators
Description
Defines various chunk combinators. The full naming scheme can be found in the Wiki. For convenience, here is a summary:
- Combinators that conflict with haskell-native functions have an underscore appended.
- Default pluralNP case for combinators will be first term singular, second term plural.
PandSdenote the pluralNP case of the combinator when it does not follow the above default.Gendenotes the general function case.- Although this should eventually be phased out,
Tdenotes a combinator meant for use with titles. NIandNPdenote whether something must be a part of theNamedIdeaorNounPhraseclass.
Synopsis
- the :: NamedIdea t => t -> NP
- theGen :: (t -> NPStruct) -> t -> NP
- a_ :: NamedIdea c => c -> NP
- a_Gen :: (c -> NPStruct) -> c -> NP
- and_ :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- and_PS :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- and_PP :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- and_TGen :: (NamedIdea c, NamedIdea d) => (c -> NPStruct) -> (d -> NPStruct) -> c -> d -> NP
- andIts :: (NamedIdea a, NamedIdea b) => a -> b -> NP
- andThe :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- of_ :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- of_NINP :: NamedIdea c => c -> NP -> NP
- of_PSNPNI :: NamedIdea d => NP -> d -> NP
- of_PS :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- ofA :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- ofAPS :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- ofThe :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- ofThePS :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- the_ofThe :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- the_ofThePS :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- onThe :: (NamedIdea a, NamedIdea b) => a -> b -> NP
- onThePS :: (NamedIdea a, NamedIdea b) => a -> b -> NP
- onThePP :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- inThe :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- inThePS :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- inThePP :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- isThe :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- toThe :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- for :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- forTGen :: (NamedIdea c, Idea d) => (c -> NPStruct) -> (d -> NPStruct) -> c -> d -> NP
- in_ :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- in_PS :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- inA :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- is :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- with :: (NamedIdea c, NamedIdea d) => c -> d -> NP
- compoundNC :: (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict
- compoundNCPP :: (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict
- compoundNCGen :: (NamedIdea a, NamedIdea b) => (NP -> NPStruct) -> (NP -> NPStruct) -> a -> b -> IdeaDict
- compoundNCPS :: IdeaDict -> IdeaDict -> IdeaDict
- compoundNCPSPP :: IdeaDict -> IdeaDict -> IdeaDict
- compoundNCGenP :: (NamedIdea a, NamedIdea b) => (NP -> NPStruct) -> a -> b -> IdeaDict
- combineNINP :: NamedIdea c => c -> NP -> NP
- combineNINI :: (NamedIdea c, NamedIdea d) => c -> d -> NP
Prepositions
"The" Combinators
theGen :: (t -> NPStruct) -> t -> NP Source #
A customizable version of the. The given function is applied to both singular and pluralNP cases.
"A" Combinators
Conjunctions
"And" Combinators
and_TGen :: (NamedIdea c, NamedIdea d) => (c -> NPStruct) -> (d -> NPStruct) -> c -> d -> NP Source #
Customizable and_ combinator (takes two title case capitalization rules and two NamedIdeas).
"Of" Combinators
of_PSNPNI :: NamedIdea d => NP -> d -> NP Source #
Same as of_ but first argument is a NounPhrase
and pluralNP case is (pluralNP t1) "of" (phraseNP t2).
of_PS :: (NamedIdea c, NamedIdea d) => c -> d -> NP Source #
Same as of_, except pluralNP case is (pluralNP t1) "of" (phraseNP t2).
ofA :: (NamedIdea c, NamedIdea d) => c -> d -> NP Source #
Same as of_PS, except combining 'NPStruct piece is "of a".
"The" Combinators
the_ofThe :: (NamedIdea c, NamedIdea d) => c -> d -> NP Source #
Same as ofThe, except prepends "the".
onThe :: (NamedIdea a, NamedIdea b) => a -> b -> NP Source #
Same as of_, except combining NPStruct piece is "on the".
onThePS :: (NamedIdea a, NamedIdea b) => a -> b -> NP Source #
Same as onThe, except pluralNP case is (pluralNP t1) NP.onThe (phraseNP t2)
onThePP :: (NamedIdea c, NamedIdea d) => c -> d -> NP Source #
Same as onThe, except pluralNP case is (pluralNP t1) NP.onThe (pluralNP t2)
"For" Combinators
forTGen :: (NamedIdea c, Idea d) => (c -> NPStruct) -> (d -> NPStruct) -> c -> d -> NP Source #
Similar to for, but takes two functions that determine the titleCase.
"In" Combinators
in_PS :: (NamedIdea c, NamedIdea d) => c -> d -> NP Source #
Same as in_, except pluralNP case is (pluralNP t1) "in" (phraseNP t2).
Other Combinators
with :: (NamedIdea c, NamedIdea d) => c -> d -> NP Source #
Case with "T1s with T2", as opposed to "T1 with T2", i.e.
singular case is (pluralNP t1) "with" (phraseNP t2) while the pluralNP case pluralizes the first.
Direct Term Combinators
Some are specific to IdeaDicts.
compoundNC :: (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict Source #
Combinator for combining two NamedIdeass into a IdeaDict.
Plural case only makes second term plural.
See compoundPhrase for more on pluralNP behaviour.
Does not preserve abbreviations.
compoundNCPP :: (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict Source #
Similar to compoundNC but both terms are pluralized for pluralNP case.
compoundNCGen :: (NamedIdea a, NamedIdea b) => (NP -> NPStruct) -> (NP -> NPStruct) -> a -> b -> IdeaDict Source #
Similar to compoundNC, except pluralNP cases are customizable.
compoundNCPS :: IdeaDict -> IdeaDict -> IdeaDict Source #
Similar to compoundNC, except for pluralNP case, where first parameter gets pluralized while second one stays singular.
compoundNCPSPP :: IdeaDict -> IdeaDict -> IdeaDict Source #
Similar to compoundNCGenP but sets first parameter function to plural.
compoundNCGenP :: (NamedIdea a, NamedIdea b) => (NP -> NPStruct) -> a -> b -> IdeaDict Source #
Similar to compoundNC, but takes a function that is applied to the first term (eg. short or plural).
combineNINI :: (NamedIdea c, NamedIdea d) => c -> d -> NP Source #
Similar to combineNINP but takes two NamedIdeas.