Copyright | (c) Klaus Luettich Christian Maeder and Uni Bremen 2002-2006 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | Christian.Maeder@dfki.de |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Common.AS_Annotation
Description
- data Annote_word
- = Annote_word String
- | Comment_start
- data Annote_text
- = Line_anno String
- | Group_anno [String]
- data Display_format
- swapTable :: [(a, b)] -> [(b, a)]
- toTable :: Show a => [a] -> [(a, String)]
- display_format_table :: [(Display_format, String)]
- lookupDisplayFormat :: Display_format -> String
- data PrecRel
- data AssocEither
- data Semantic_anno
- = SA_cons
- | SA_def
- | SA_implies
- | SA_mono
- | SA_implied
- | SA_mcons
- | SA_ccons
- | SA_wdef
- semantic_anno_table :: [(Semantic_anno, String)]
- lookupSemanticAnno :: Semantic_anno -> String
- data Annotation
- = Unparsed_anno Annote_word Annote_text Range
- | Display_anno Id [(Display_format, String)] Range
- | List_anno Id Id Id Range
- | Number_anno Id Range
- | Float_anno Id Id Range
- | String_anno Id Id Range
- | Prec_anno PrecRel [Id] [Id] Range
- | Assoc_anno AssocEither [Id] Range
- | Label [String] Range
- | Prefix_anno [(String, IRI)] Range
- | Semantic_anno Semantic_anno Range
- isLabel :: Annotation -> Bool
- isImplies :: Annotation -> Bool
- isImplied :: Annotation -> Bool
- isSemanticAnno :: Annotation -> Bool
- isComment :: Annotation -> Bool
- isAnnote :: Annotation -> Bool
- partPrefixes :: [Annotation] -> (Map String IRI, [Annotation])
- data Annoted a = Annoted {
- item :: a
- opt_pos :: Range
- l_annos :: [Annotation]
- r_annos :: [Annotation]
- annoRange :: (a -> [Pos]) -> Annoted a -> [Pos]
- notImplied :: Annoted a -> Bool
- data SenOrigin = SenOrigin {
- dGraphName :: IRI
- originNodeId :: Node
- senName :: String
- data SenAttr s a = SenAttr {}
- makeNamed :: a -> s -> SenAttr s a
- setOrigin :: IRI -> Node -> String -> SenAttr s a -> SenAttr s a
- setOriginIfLocal :: IRI -> Node -> String -> SenAttr s a -> SenAttr s a
- type Named s = SenAttr s String
- markSen :: String -> Named s -> Named s
- unmark :: Named s -> Named s
- reName :: (a -> b) -> SenAttr s a -> SenAttr s b
- mapNamed :: (s -> t) -> SenAttr s a -> SenAttr t a
- mapNamedM :: Monad m => (s -> m t) -> Named s -> m (Named t)
- mapAnM :: Monad m => (a -> m b) -> [Annoted a] -> m [Annoted b]
- replaceAnnoted :: b -> Annoted a -> Annoted b
- appendAnno :: Annoted a -> [Annotation] -> Annoted a
- addLeftAnno :: [Annotation] -> a -> Annoted a
- emptyAnno :: a -> Annoted a
- getRLabel :: Annoted a -> String
- identAnno :: String -> Annotation -> Bool
- hasIdentAnno :: String -> Annoted a -> Bool
- getPriority :: [Annotation] -> Maybe String
- makeNamedSen :: Annoted a -> Named a
- annoArg :: Annote_text -> String
- newtype Name = Name String
- getAnnoName :: Annoted a -> Name
Documentation
data Annote_word Source #
start of an annote with its WORD or a comment
Constructors
Annote_word String | |
Comment_start |
Instances
Eq Annote_word Source # | |
Data Annote_word Source # | |
Ord Annote_word Source # | |
Show Annote_word Source # | |
GetRange Annote_word Source # | |
data Annote_text Source #
line or group for Unparsed_anno
Constructors
Line_anno String | |
Group_anno [String] |
Instances
Eq Annote_text Source # | |
Data Annote_text Source # | |
Ord Annote_text Source # | |
Show Annote_text Source # | |
GetRange Annote_text Source # | |
data Display_format Source #
formats to be displayed (may be extended in the future). Drop 3 from the show result to get the string for parsing and printing
Instances
Eq Display_format Source # | |
Data Display_format Source # | |
Ord Display_format Source # | |
Show Display_format Source # | |
GetRange Display_format Source # | |
display_format_table :: [(Display_format, String)] Source #
a lookup table for the textual representation of display formats
lookupDisplayFormat :: Display_format -> String Source #
lookup the textual representation of a display format
in display_format_table
precedence Lower
means less and BothDirections
means less and greater.
Higher
means greater but this is syntactically not allowed in Prec_anno
.
NoDirection
can also not be specified explicitly,
but covers those ids that are not mentionend in precedences.
Constructors
Higher | |
Lower | |
BothDirections | |
NoDirection |
data AssocEither Source #
either left or right associative
Instances
Eq AssocEither Source # | |
Data AssocEither Source # | |
Ord AssocEither Source # | |
Show AssocEither Source # | |
GetRange AssocEither Source # | |
data Semantic_anno Source #
semantic (line) annotations without further information.
Use the same drop-3-trick as for the Display_format
.
Constructors
SA_cons | |
SA_def | |
SA_implies | |
SA_mono | |
SA_implied | |
SA_mcons | |
SA_ccons | |
SA_wdef |
Instances
Bounded Semantic_anno Source # | |
Enum Semantic_anno Source # | |
Eq Semantic_anno Source # | |
Data Semantic_anno Source # | |
Ord Semantic_anno Source # | |
Show Semantic_anno Source # | |
GetRange Semantic_anno Source # | |
semantic_anno_table :: [(Semantic_anno, String)] Source #
a lookup table for the textual representation of semantic annos
lookupSemanticAnno :: Semantic_anno -> String Source #
lookup the textual representation of a semantic anno
in semantic_anno_table
data Annotation Source #
all possible annotations (without comment-outs)
Constructors
Unparsed_anno Annote_word Annote_text Range | constructor for comments or unparsed annotes |
Display_anno Id [(Display_format, String)] Range | known annotes |
List_anno Id Id Id Range | |
Number_anno Id Range | |
Float_anno Id Id Range | |
String_anno Id Id Range | |
Prec_anno PrecRel [Id] [Id] Range | |
Assoc_anno AssocEither [Id] Range | |
Label [String] Range | |
Prefix_anno [(String, IRI)] Range | |
Semantic_anno Semantic_anno Range |
Instances
Eq Annotation Source # | |
Data Annotation Source # | |
Ord Annotation Source # | |
Show Annotation Source # | |
GetRange Annotation Source # | |
Pretty Annotation Source # | |
ATermConvertibleSML Annotation Source # | |
isLabel :: Annotation -> Bool Source #
isLabel
tests if the given Annotation
is a label
(a Label
typically follows a formula)
isImplies :: Annotation -> Bool Source #
isImplied :: Annotation -> Bool Source #
isSemanticAnno :: Annotation -> Bool Source #
isSemanticAnno
tests if the given Annotation
is a semantic one
isComment :: Annotation -> Bool Source #
isComment
tests if the given Annotation
is a comment line or a
comment group
partPrefixes :: [Annotation] -> (Map String IRI, [Annotation]) Source #
separate prefix annotations and put them into a map
an item wrapped in preceding (left l_annos
)
and following (right r_annos
) annotations.
opt_pos
should carry the position of an optional semicolon
following a formula (but is currently unused).
Constructors
Annoted | |
Fields
|
Instances
Functor Annoted Source # | |
Eq a => Eq (Annoted a) Source # | |
Data a => Data (Annoted a) Source # | |
Ord a => Ord (Annoted a) Source # | |
Show a => Show (Annoted a) Source # | |
GetRange a => GetRange (Annoted a) Source # | |
Pretty a => Pretty (Annoted a) Source # | |
ListCheck a => ListCheck (Annoted a) Source # | an instance of ListCheck for Annoted stuff |
PrettyLG a => PrettyLG (Annoted a) Source # | |
ShATermLG a => ShATermLG (Annoted a) Source # | |
ATermConvertibleSML a => ATermConvertibleSML (Annoted a) Source # | |
notImplied :: Annoted a -> Bool Source #
origin of sentences
Constructors
SenOrigin | |
Fields
|
naming or labelling sentences
Constructors
SenAttr | |
Instances
(Eq s, Eq a) => Eq (SenAttr s a) Source # | |
(Data a, Data s) => Data (SenAttr s a) Source # | |
(Ord s, Ord a) => Ord (SenAttr s a) Source # | |
(Show s, Show a) => Show (SenAttr s a) Source # | |
(GetRange s, GetRange a) => GetRange (SenAttr s a) Source # | |
(ShATermLG s, ShATermLG a) => ShATermLG (SenAttr s a) Source # | |
setOrigin :: IRI -> Node -> String -> SenAttr s a -> SenAttr s a Source #
set the origin of a named sentence
setOriginIfLocal :: IRI -> Node -> String -> SenAttr s a -> SenAttr s a Source #
set the origin of a named sentence, if the sentence does not already have an origin, owise leave unchanged
mapNamed :: (s -> t) -> SenAttr s a -> SenAttr t a Source #
extending sentence maps to maps on labelled sentences
mapNamedM :: Monad m => (s -> m t) -> Named s -> m (Named t) Source #
extending sentence maybe-maps to maps on labelled sentences
mapAnM :: Monad m => (a -> m b) -> [Annoted a] -> m [Annoted b] Source #
process all items and wrap matching annotations around the results
appendAnno :: Annoted a -> [Annotation] -> Annoted a Source #
add further following annotations
addLeftAnno :: [Annotation] -> a -> Annoted a Source #
put together preceding annotations and an item
identAnno :: String -> Annotation -> Bool Source #
check for an annotation starting with % and the input str (does not work for known annotation words)
hasIdentAnno :: String -> Annoted a -> Bool Source #
test all anntotions for an item
getPriority :: [Annotation] -> Maybe String Source #
makeNamedSen :: Annoted a -> Named a Source #
annoArg :: Annote_text -> String Source #
getAnnoName :: Annoted a -> Name Source #