summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Infra
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2015-05-11 14:11:42 +0000
committerkrasimir <krasimir@chalmers.se>2015-05-11 14:11:42 +0000
commitb4e41cabddd2d7f48b73e9122171575d7e43bd6e (patch)
treec45d314e12d00ed5c9f8cc132d8c770cdfb71333 /src/compiler/GF/Infra
parent1e0d7be4f4322836093d744c916fe02bfbcf9418 (diff)
"flags case_sensitive=off" makes the parser case insensitive
Diffstat (limited to 'src/compiler/GF/Infra')
-rw-r--r--src/compiler/GF/Infra/Option.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/GF/Infra/Option.hs b/src/compiler/GF/Infra/Option.hs
index 6070e9a38..51aa44b82 100644
--- a/src/compiler/GF/Infra/Option.hs
+++ b/src/compiler/GF/Infra/Option.hs
@@ -173,6 +173,7 @@ data Flags = Flags {
optDump :: [Dump],
optTagsOnly :: Bool,
optHeuristicFactor :: Maybe Double,
+ optCaseSensitive :: Bool,
optPlusAsBind :: Bool,
optJobs :: Maybe (Maybe Int)
}
@@ -217,10 +218,11 @@ optionsGFO opts = optionsPGF opts
-- | Pretty-print the options that are preserved in .pgf files.
optionsPGF :: Options -> [(String,Literal)]
-optionsPGF opts =
+optionsPGF opts =
maybe [] (\x -> [("language",LStr x)]) (flag optSpeechLanguage opts)
++ maybe [] (\x -> [("startcat",LStr x)]) (flag optStartCat opts)
++ maybe [] (\x -> [("heuristic_search_factor",LFlt x)]) (flag optHeuristicFactor opts)
+ ++ (if flag optCaseSensitive opts then [] else [("case_sensitive",LStr "off")])
-- Option manipulation
@@ -282,6 +284,7 @@ defaultFlags = Flags {
optDump = [],
optTagsOnly = False,
optHeuristicFactor = Nothing,
+ optCaseSensitive = True,
optPlusAsBind = False,
optJobs = Nothing
}
@@ -365,6 +368,7 @@ optDescr =
Option [] ["cse"] (onOff (toggleOptimize OptCSE) True) "Perform common sub-expression elimination (default on).",
Option [] ["cfg"] (ReqArg cfgTransform "TRANS") "Enable or disable specific CFG transformations. TRANS = merge, no-merge, bottomup, no-bottomup, ...",
Option [] ["heuristic_search_factor"] (ReqArg (readDouble (\d o -> o { optHeuristicFactor = Just d })) "FACTOR") "Set the heuristic search factor for statistical parsing",
+ Option [] ["case_sensitive"] (onOff (\v -> set $ \o -> o{optCaseSensitive=v}) True) "Set the parser in case-sensitive/insensitive mode [sensitive by default]",
Option [] ["plus-as-bind"] (NoArg (set $ \o -> o{optPlusAsBind=True})) "Uses of (+) with runtime variables automatically generate BIND (experimental feature).",
dumpOption "source" Source,
dumpOption "rebuild" Rebuild,