Portability | portable |
---|---|
Stability | experimental |
Maintainer | eric.kow@gmail.com |
Safe Haskell | Safe-Infered |
Discourse history tracking
- isExact :: RefGroup -> Bool
- mkSingletonDu :: RefKey -> DiscourseUnit
- data RefHistory = RefHistory {}
- type RefCount = Int
- plusRefCount :: RefCount -> RefCount -> RefCount
- emptyHistory :: RefHistory
- addToHistory :: [DiscourseUnit] -> RefHistory -> RefHistory
- duSingletons :: DiscourseUnit -> [RefKey]
- refSingleton :: RefGroup -> Maybe RefKey
- noteImplicitBounds :: RefGroup -> RefGroup
- hasDistractorGroup :: RefHistory -> RefKey -> Bool
- distractorGroups :: RefHistory -> RefKey -> [DiscourseUnit]
- hasSupersetMention :: RefHistory -> DiscourseUnit -> Bool
- supersetMentions :: DiscourseUnit -> RefHistory -> RefHistory
- lastMention :: RefHistory -> RefKey -> Int
- lastMentions :: RefHistory -> DiscourseUnit -> Int
- isFirstMention :: RefHistory -> RefKey -> Bool
- mentionOrder :: RefHistory -> RefKey -> Maybe Int
- hasTidyBackpointer :: RefHistory -> DiscourseUnit -> Bool
- isTheOther :: RefHistory -> RefKey -> Bool
- isClasswide :: RefGroup -> Bool
- subtrees :: Tree a -> [Tree a]
- mkLeaf :: a -> Tree a
- fst3 :: (a, b, c) -> a
- snd3 :: (a, b, c) -> b
- thd3 :: (a, b, c) -> c
Documentation
isExact :: RefGroup -> BoolSource
A RefGroup
is considered to refer exactly to its indices if it
has no bounds information or examples associated with it.
mkSingletonDu :: RefKey -> DiscourseUnitSource
A discourse unit that would refer to just an element
data RefHistory Source
RefHistory | |
|
plusRefCount :: RefCount -> RefCount -> RefCountSource
emptyHistory :: RefHistorySource
Discourse history without any objects
addToHistory :: [DiscourseUnit] -> RefHistory -> RefHistorySource
Take note of the fact that these discourse units have been mentioned (again) in the history.
You probably want to realise the units first, then add them to the history.
duSingletons :: DiscourseUnit -> [RefKey]Source
Individuals mentioned in a discourse unit
(see refSingleton
)
refSingleton :: RefGroup -> Maybe RefKeySource
A refSingleton
is an instance that appears by itself in a RefGroup
without other items or constraints that imply that there could be other
items
noteImplicitBounds :: RefGroup -> RefGroupSource
If a RefGroup has explicit constraints, augment them with the implicit constraints that arise from treating each item as evidence of an at least constraint
It's a good idea to run this once when building RefGroup
s,
but you may also decide that this sort of behaviour is not
desirable for your application, so it's off by default
hasDistractorGroup :: RefHistory -> RefKey -> BoolSource
hasDistractorGroup st k
returns whether or not the discourse history
st
contains a group with distractors to k
.
See distractorGroups
for more details
distractorGroups :: RefHistory -> RefKey -> [DiscourseUnit]Source
distractorGroups st k
returns all the distractor groups for k
in the discourse history.
A distractor is defined (here) as something that has the the same class
as k
but a different index.
hasSupersetMention :: RefHistory -> DiscourseUnit -> BoolSource
hasSupersetMention st g
returns whether or not the discourse history
contains a group that includes all members of g
Note that if a group has already occured in the discourse history, this returns a True (ie. not a strict superset)
supersetMentions :: DiscourseUnit -> RefHistory -> RefHistorySource
supersetMentions g st
returns the portion of discourse history st
in which all groups are supersets of g
(inclusive, not strict super)
lastMention :: RefHistory -> RefKey -> IntSource
lastMention st k
returns the number of times k
has been mentioned
lastMentions :: RefHistory -> DiscourseUnit -> IntSource
lastMention st g
returns the number of times the group g
has been
mentioned
isFirstMention :: RefHistory -> RefKey -> BoolSource
mentionOrder :: RefHistory -> RefKey -> Maybe IntSource
If it makes sense to refer to a key using an ordinal expression, the order we should assign it (Nothing if we either can't sensibly assign one, or the history does not give us enough information to do so)
hasTidyBackpointer :: RefHistory -> DiscourseUnit -> BoolSource
Is a subset of a previously mentioned group g
where there are no
distractors to g
in the discourse history
isTheOther :: RefHistory -> RefKey -> BoolSource
isTheOther st k
returns whether or not there is a two-member group in
the discourse history which k
is a member of such that the other
member has already been mentioned as a part of a singleton group.
The idea is that if you have said one of the X, you will want to say the other X for the other member of that group
isClasswide :: RefGroup -> BoolSource
Is the class itself, not any individual entity within that class ie. “ants” instead of “an ant” or “some ants”
By convention, any group which containts no indices or constraints is considered to be classwide.