module Language.Drasil.Sentence.Extract(sdep, shortdep, lnames, lnames') where
import Data.List (nub)
import Language.Drasil.UID (UID)
import Language.Drasil.Sentence(Sentence(..), SentenceStyle(..))
import Language.Drasil.ModelExpr.Extract (meNames)
getUIDs :: Sentence -> [UID]
getUIDs :: Sentence -> [UID]
getUIDs (Ch SentenceStyle
ShortStyle TermCapitalization
_ UID
_) = []
getUIDs (Ch SentenceStyle
TermStyle TermCapitalization
_ UID
_) = []
getUIDs (Ch SentenceStyle
PluralTerm TermCapitalization
_ UID
_) = []
getUIDs (SyCh UID
a) = [UID
a]
getUIDs Sy {} = []
getUIDs S {} = []
getUIDs P {} = []
getUIDs Ref {} = []
getUIDs Sentence
Percent = []
getUIDs ((:+:) Sentence
a Sentence
b) = Sentence -> [UID]
getUIDs Sentence
a forall a. [a] -> [a] -> [a]
++ Sentence -> [UID]
getUIDs Sentence
b
getUIDs (Quote Sentence
a) = Sentence -> [UID]
getUIDs Sentence
a
getUIDs (E ModelExpr
a) = ModelExpr -> [UID]
meNames ModelExpr
a
getUIDs Sentence
EmptyS = []
getUIDshort :: Sentence -> [UID]
getUIDshort :: Sentence -> [UID]
getUIDshort (Ch SentenceStyle
ShortStyle TermCapitalization
_ UID
a) = [UID
a]
getUIDshort (Ch SentenceStyle
TermStyle TermCapitalization
_ UID
_) = []
getUIDshort (Ch SentenceStyle
PluralTerm TermCapitalization
_ UID
_) = []
getUIDshort SyCh {} = []
getUIDshort Sy {} = []
getUIDshort S {} = []
getUIDshort Sentence
Percent = []
getUIDshort P {} = []
getUIDshort Ref {} = []
getUIDshort ((:+:) Sentence
a Sentence
b) = Sentence -> [UID]
getUIDshort Sentence
a forall a. [a] -> [a] -> [a]
++ Sentence -> [UID]
getUIDshort Sentence
b
getUIDshort (Quote Sentence
a) = Sentence -> [UID]
getUIDshort Sentence
a
getUIDshort E {} = []
getUIDshort Sentence
EmptyS = []
sdep :: Sentence -> [UID]
sdep :: Sentence -> [UID]
sdep = forall a. Eq a => [a] -> [a]
nub forall b c a. (b -> c) -> (a -> b) -> a -> c
. Sentence -> [UID]
getUIDs
shortdep :: Sentence -> [UID]
shortdep :: Sentence -> [UID]
shortdep = forall a. Eq a => [a] -> [a]
nub forall b c a. (b -> c) -> (a -> b) -> a -> c
. Sentence -> [UID]
getUIDshort
lnames :: Sentence -> [UID]
lnames :: Sentence -> [UID]
lnames Ch {} = []
lnames SyCh {} = []
lnames Sy {} = []
lnames S {} = []
lnames Sentence
Percent = []
lnames P {} = []
lnames (Ref UID
a Sentence
_ RefInfo
_) = [UID
a]
lnames ((:+:) Sentence
a Sentence
b) = Sentence -> [UID]
lnames Sentence
a forall a. [a] -> [a] -> [a]
++ Sentence -> [UID]
lnames Sentence
b
lnames Quote {} = []
lnames E {} = []
lnames Sentence
EmptyS = []
lnames' :: [Sentence] -> [UID]
lnames' :: [Sentence] -> [UID]
lnames' = forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap Sentence -> [UID]
lnames