| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Language.Drasil.NounPhrase.Combinators
Description
Defines various NounPhrase-level combinators. These hold more information than those of the Sentence level but may not necessarily have a conceptual link. See the Wiki for more information and details about the naming process for combinators. A summary of the function naming scheme is as follows:
- Combinators that conflict with haskell-native functions have an underscore appended.
- Default plural case for combinators will be first term singular, second term plural.
PandSdenote the plural case of the combinator when it does not follow the above default.Gendenotes the general function case.
This module should be used as a qualified import (usually as NP),
as many function names clash with those in Concepts.hs and Sentence.hs.
Synopsis
- insertString :: String -> NP -> NP -> NP
- prependString :: String -> NP -> NP
- insertStringOp :: String -> NP -> NP -> NP
- insertStringGen :: String -> (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
- the :: NP -> NP
- theGen :: (NP -> NPStruct) -> NP -> NP
- a_ :: NP -> NP
- a_Gen :: (NP -> NPStruct) -> NP -> NP
- and_ :: NP -> NP -> NP
- and_PS :: NP -> NP -> NP
- and_Gen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
- andThe :: NP -> NP -> NP
- ofThe :: NP -> NP -> NP
- ofThePS :: NP -> NP -> NP
- ofTheGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
- inThe :: NP -> NP -> NP
- inThePS :: NP -> NP -> NP
- inTheGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
- the_ofThe :: NP -> NP -> NP
- the_ofThePS :: NP -> NP -> NP
- the_ofTheGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
- for :: NP -> NP -> NP
- forPS :: NP -> NP -> NP
- forGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
- of_ :: NP -> NP -> NP
- of_PS :: NP -> NP -> NP
- of_Gen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP
- with :: NP -> NP -> NP
- parensNP :: NP -> NP
- data NPStruct
General Combinator Helper Functions
insertStringOp :: String -> NP -> NP -> NP Source #
Helper function that places a String in between two NPs. Plural case is
(pluralNP t1) :+: S s :+: (phraseNP t2), i.e. opposite of insertString
Prepositions
"The" Combinators
theGen :: (NP -> NPStruct) -> NP -> NP Source #
Similar to the, but accepts a function that determines the plural case.
"A" Combinators
a_Gen :: (NP -> NPStruct) -> NP -> NP Source #
Similar to a, but accepts a function that determines the plural case.
Conjunctions
"And" Combinators
and_ :: NP -> NP -> NP Source #
Inserts "and" between two NPs. Plural case is (phraseNP t1) :+: "and" :+: (pluralNP t2).
and_Gen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP Source #
Same as and_, but takes two functions for the plural case.
andThe :: NP -> NP -> NP Source #
Inserts "and the" between two NPs. Plural case is (phraseNP t1) :+: "and the" :+: (pluralNP t2).
"The" Combinators
ofThe :: NP -> NP -> NP Source #
Inserts "of the" between two NPs. Plural case is (phraseNP t1) :+: "of the" :+: (pluralNP t2).
ofTheGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP Source #
Similar to ofThe, but accepts two functions for the plural case.
inThe :: NP -> NP -> NP Source #
Inserts "in the" between two NPs. Plural case is (phraseNP t1) :+: "in the" :+: (pluralNP t2).
inTheGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP Source #
Similar to ofThe, but accepts two functions for the plural case.
the_ofThe :: NP -> NP -> NP Source #
Prepends "the" and inserts "of the". Plural case is "the" :+: (phraseNP t1) :+: "of the" :+: (pluralNP t2).
the_ofTheGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP Source #
Similar to the_ofThe', but takes two functions for the plural case.
"For" Combinators
for :: NP -> NP -> NP Source #
Inserts "for" between two NPs. Plural case is (phraseNP t1) :+: "for" :+: (pluralNP t2).
forGen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP Source #
Same as for', but takes two functions for the plural case.
"Of" Combinators
of_ :: NP -> NP -> NP Source #
Inserts "of" between two NPs. Plural case is (phraseNP t1) :+: "of" :+: (pluralNP t2).
of_Gen :: (NP -> NPStruct) -> (NP -> NPStruct) -> NP -> NP -> NP Source #
Same as of_, but takes two functions for the plural case.
Other Combinators
with :: NP -> NP -> NP Source #
Inserts "with" between two NPs. Plural case is (phraseNP t1) :+: "with" :+: (pluralNP t2).
Puts parentheses around a word; to be used as a kind of postfix qualifier