Copyright | (c) Harm Brouwer and Noortje Venhuizen |
---|---|
License | Apache-2.0 |
Maintainer | me@hbrouwer.eu, n.j.venhuizen@rug.nl |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
String to DRS
Synopsis
- stringToDRS :: String -> DRS
- opNegString :: [String]
- opImpString :: [String]
- opOrString :: [String]
- opBoxString :: [String]
- opDiamondString :: [String]
- data BracketType
- = Parentheses
- | Curly
- | Angle
- | Square
- brackets :: BracketType -> (Char, Char)
- felicitousBracketing :: String -> Bool
- dropOuterBrackets :: String -> String
- takeUpToMatchingBracket :: BracketType -> String -> String
- dropUpToMatchingBracket :: BracketType -> String -> String
- replaceArrows :: String -> String
- splitOn :: Char -> String -> [String]
Exported
String to DRS conversion
String representations for operators
opNegString :: [String] #
Negation operators (case insensitive): !, not, neg
.
opImpString :: [String] #
Implication operators (case insensitive): imp, ->, =>, then
.
opOrString :: [String] #
Disjuction operators (case insensitive): v, or
.
opBoxString :: [String] #
Box operators (case insensitive): b, box, necessary
.
opDiamondString :: [String] #
Diamond operators (case insensitive): d, diamond, maybe
.
Auxiliary functions for string parsing
brackets :: BracketType -> (Char, Char) #
Returns tuple with brackets from given BracketType
.
felicitousBracketing :: String -> Bool #
Checks if 'String s
' contains the same number of opening and
closing brackets of the same type.
dropOuterBrackets :: String -> String #
Removes the outer brackets from a String
.
takeUpToMatchingBracket :: BracketType -> String -> String #
Returns part of String
s
between opening bracket ob
of type bt
and its matching closing bracket.
dropUpToMatchingBracket :: BracketType -> String -> String #
Returns part of String
s
after opening bracket ob
of type bt
and its matching closing bracket.
replaceArrows :: String -> String #
Replaces ASCII representations of arrows in String
s
by operator
"imp"
.