diff options
| author | hallgren <hallgren@chalmers.se> | 2015-02-24 15:04:06 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2015-02-24 15:04:06 +0000 |
| commit | e68370e46308815b7c75d99bec9a27d44606584b (patch) | |
| tree | 94491fa239302f080a505cdf7bbaff9a3e7a3c07 /src | |
| parent | 715ac1ca6242f912f348b3d5c45d7dca295a8da2 (diff) | |
PGFService.hs: text lexer: slightly smarter decapitalization of the first word of a sentence
Keep the first letter in upper case if it is followed by more upper case
letters.
(Also remove some left over debugging output.)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/PGFService.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/server/PGFService.hs b/src/server/PGFService.hs index 79e286deb..5c8e23edd 100644 --- a/src/server/PGFService.hs +++ b/src/server/PGFService.hs @@ -63,7 +63,6 @@ type Caches = (Cache PGF,(Cache (C.PGF,({-MVar ParseCache-})),QSem)) newPGFCache jobs = do pgfCache <- newCache' PGF.readPGF let n = maybe 4 id jobs - putStrLn $ "Parallel parsing limit: "++show n qsem <- newQSem n cCache <- newCache' $ \ path -> do pgf <- C.readPGF path --pc <- newMVar Map.empty @@ -296,9 +295,9 @@ instance JSON C.Expr where -- | Lexers with a text lexer that tries to be a more clever with the first word ilexer good = lexer' uncap where - uncap s = if good s - then s - else uncapitInit s + uncap s = case span isUpper s of + ([c],r) | not (good s) -> toLower c:r + _ -> s -- | Standard lexers lexer = lexer' uncapitInit |
