Use right start category names in si command.

This commit is contained in:
bringert
2006-01-20 18:20:02 +00:00
parent 05377a9a65
commit 036de8d94e
5 changed files with 6 additions and 6 deletions

View File

@@ -216,7 +216,7 @@ speechInput opt s = recognizeSpeech name language cfg cat number
name = cncId s name = cncId s
cfg = stateCFG s -- FIXME: use lang flag to select grammar cfg = stateCFG s -- FIXME: use lang flag to select grammar
language = fromMaybe "en_UK" (getOptVal opts speechLanguage) language = fromMaybe "en_UK" (getOptVal opts speechLanguage)
cat = fromMaybe "S" (getOptVal opts gStartCat) cat = fromMaybe "S" (getOptVal opts gStartCat) ++ "{}.s"
number = optIntOrN opts flagNumber 1 number = optIntOrN opts flagNumber 1
optLinearizeTreeVal :: Options -> GFGrammar -> Tree -> String optLinearizeTreeVal :: Options -> GFGrammar -> Tree -> String

View File

@@ -81,8 +81,8 @@ unionAll = nub . concat
-- | Like 'lookup', but fails if the argument is not found, -- | Like 'lookup', but fails if the argument is not found,
-- instead of returning Nothing. -- instead of returning Nothing.
lookup' :: Eq a => a -> [(a,b)] -> b lookup' :: (Show a, Eq a) => a -> [(a,b)] -> b
lookup' x = fromJust . lookup x lookup' x = fromMaybe (error $ "Not found: " ++ show x) . lookup x
-- | Like 'find', but fails if nothing is found. -- | Like 'find', but fails if nothing is found.
find' :: (a -> Bool) -> [a] -> a find' :: (a -> Bool) -> [a] -> a

View File

@@ -229,7 +229,7 @@ compileAutomata g = [(c, makeOneFA c) | c <- allCats g]
-- | The make_fa algorithm from \"Regular approximation of CFLs: a grammatical view\", -- | The make_fa algorithm from \"Regular approximation of CFLs: a grammatical view\",
-- Mark-Jan Nederhof. International Workshop on Parsing Technologies, 1997, -- Mark-Jan Nederhof. International Workshop on Parsing Technologies, 1997,
-- adapted to build a finite automaton for a single (mutually recursive) set only. -- adapted to build a finite automaton for a single (mutually recursive) set only.
-- Categories not in the set (fromJustMap.lookup c mrs)will result in category-labelled edges. -- Categories not in the set will result in category-labelled edges.
make_fa1 :: MutRecSet -- ^ The set of (mutually recursive) categories for which make_fa1 :: MutRecSet -- ^ The set of (mutually recursive) categories for which
-- we are building the automaton. -- we are building the automaton.
-> State -- ^ State to come from -> State -- ^ State to come from

View File

@@ -36,7 +36,7 @@ import GF.Speech.FiniteState
import Control.Monad import Control.Monad
import Data.FiniteMap import Data.FiniteMap
import Data.List import Data.List
import Data.Maybe (fromJust, fromMaybe) import Data.Maybe (fromMaybe)
import Data.Set (Set) import Data.Set (Set)
import qualified Data.Set as Set import qualified Data.Set as Set

View File

@@ -54,7 +54,7 @@ AREC: WORDPEN = -10.0
HNET: FORCECXTEXP = T HNET: FORCECXTEXP = T
HNET: ALLOWXWRDEXP = F HNET: ALLOWXWRDEXP = F
HNET: MARKSUBLAT = T HNET: MARKSUBLAT = F
ARMAN: AUTOSIL = F ARMAN: AUTOSIL = F
HREC: CONFSCALE = 0.15 HREC: CONFSCALE = 0.15