-
Notifications
You must be signed in to change notification settings - Fork 26
Combinator Documentation
The purpose of this page is to help users and contributors easily see the combinators for English that currently exist in Drasil and are available for use. This will also help to keep all of the different combinators organized and to separate them by their English meanings. As brought up in issue #2399, we are trying to encapsulate the knowledge associated with common English combinators as a means to generalize Drasil's language while making readability of the code clearer. So far, we have separated these combinators into four levels:
-
Level 1:
Sentence
level. These combinators can only be used to join twoSentences
, and they do not hold any semantic meaning usable by Drasil. In other words, they are only surface level combinators and are unable to produce a sophisticated idea from two simpler ideas. When joining concepts, these should only be used when the relationship between the phrases is unable to be expressed with any higher-level combinators. -
Level 2:
NounPhrase
level. The combinators listed here are better thanSentence
-level combinators as they can hold information about pluralization and capitalization rules. As a result, Drasil can utilize these combinators in more powerful ways because it can know the rules that govern how an appliedSentence
should look. Because of the nature of theNP
type (having the ability to hold knowledge of singular, plural, capital, and title cases), these combinators can easily replace manySentence
-level combinators and give Drasil more knowledge when recording information. -
Level 3:
NamedIdea
or conceptual level. These combinators are similar to theNounPhrase
combinators, except they are able to hold the semantic meaning of the combinator. These represent a new idea that is built upon multiple simpler ideas, allowing Drasil to grow its knowledge of such ideas. The combinators at this level are ideal and practical for use in Drasil, but they are more difficult to implement. One must be able to see the underlying patterns that are within English, and then apply them using these combinators. For example, something like theofThe
combinator will allow us to contain the knowledge that the first idea is a unique attribute of the second idea. -
Level 4: Things above
NamedIdeas
that are amenable to joining. This is ideal and something to aim for, but a little too early to start incorporating consistently.
Many of these combinators act like inserting words into the middle of an English sentence (unless noted otherwise). Please see the Haddock documentation for more details on each combinator. (Subject to change: prepending s
to combinator names)
Combinators with "the":
andThe
fromThe
inThe
isThe
toThe
ofThe
-
the_ofThe
(combines twoSentences
with "of the" and prepends "the" to them) -
the_ofThe'
(combines twoSentences
with "of the" and prepends capitalized "The" to them)
Common combinators (without "the"):
sOf
sOfA
sOr
sAnd
sAre
sIn
sIs
sFor
andIts
Uncommon combinators:
-
isExpctToHv
(prepends "the" before combining with "is expected to have") -
ofGiv
(prepends "the" before combining with "of a given") -
ofGiv'
(prepends capitalized "The" before combining with "of a given") sVersus
-
denotes
(inserts "denotes the") -
wrt
(inserts "with respect to") -
defnAs
(inserts "defined as")
Unusual combinators:
-
sFor'
(titleizes and combines twoNamedIdeas
into aSentence
using "for") -
sFor''
(titleizes and takes two functions to apply toNamedIdeas
before combining into aSentence
using "for") -
forTT
(titleizes and pluralizes firstNamedIdea
before combining into aSentence
using "for") -
forTT'
(titleizes and pluralizes bothNamedIdeas
before combining into aSentence
using "for")
These combinators have many variations, as pluralization and capitalization rules may vary greatly between different use cases. Please see the Haddock documentation for more details and the specifics of each combinator. (Subject to change: Naming convention appending NP to the end of the combinator name)
Generalized combinators (mostly used as helpers for other combinators but can still be used for a custom combinator):
-
insertStringNP
(inserts a givenString
into twoNPs
. Plural case pluralizes second term.) -
insertSentNP
(inserts a givenSentence
into twoNPs
. Plural case pluralizes second term.) -
prependStringNP
(prepends a givenString
to aNP
) -
prependSentNP (prepends a given
Sentenceto a
NP`)
Article combinators (the, a):
theNP
-
theNP'
(accepts a function to determine plural case) aNP
-
aNP'
(accepts a function to determine plural case)
Common combinators (appending a '
means plural case pluralizes first term. Appending ''
means plural case accepts two functions.):
ofTheNP
inTheNP
the_ofTheNP
forNP
ofNP
andNP
Unusual combinators:
-
withNP
(no'
or''
case) -
ofNP
(has a'''
case that takes two functions for singular case and two for plural case) -
andNP
(has a'''
case that takes two functions for singular case and two for plural case)
These combinators take NamedIdeas
and make a NP
from them. Because of the variety of pluralization and capitalization, there are many variants of each combinator. Please visit the Haddock documentation for more details and the specifics of each combinator. (Subject to change: Naming scheme with '
and _
)
Common combinators:
and_
and_'
andRT
for
for'
of_
of_'
of_''
of__
ofN_
ofA
ofA'
the
the'
the''
inThe'
with
ofThe'
the_ofThe''
Please see Haddock documentation for more information.
NamedIdea
and NamedChunk
combinators (does not preserve abbreviations):
compoundNC
compoundNC'
compoundNC''
compoundNC'''
compoundNCPl
compoundNCPlPh
Future changes include:
- Removing
s
,NP
naming convention and allowing qualified imports to determine the different levels of combinators. - Change method for naming different Singular and Plural operators as follows:
-
_
used for combinators that would otherwise clash with Haskell syntax - Base combinators will default plural case to
singular t1, plural t2
- append
S
andP
to specify the plural case - append
T
to specify title case - append
Gen
for general case (no specified plural case)
-
- Home
- Getting Started
- Documentation (of Drasil specifics)
- Design
-
Readings
- Drasil Papers and Documents
- Related Work and Inspiration
- Writing Documentation
- Compression as a Means to Learn Structure
- Glossary, Taxonomy, Ontology
- Grounded Theory
- Model Driven Scrapbook
- Model Transformation Languages
- ODE Definitions
- The Code Generator
- Suggested Reading
- Sustainability
- Productivity
- Reuse
- Formal Concept Analysis
- Generative Programming
- Software Documentation
- Units and Quantities
- Misc.
- WIP Projects