forked from GitHub/gf-core
SRG category renaming: don't count the external cats when calculating indices.
This commit is contained in:
@@ -124,7 +124,7 @@ renameCats prefix cfg = mapCFGCats renameCat cfg
|
|||||||
where renameCat c | isExternal c = c ++ "_cat"
|
where renameCat c | isExternal c = c ++ "_cat"
|
||||||
| otherwise = Map.findWithDefault (error ("renameCats: " ++ c)) c names
|
| otherwise = Map.findWithDefault (error ("renameCats: " ++ c)) c names
|
||||||
isExternal c = c `Set.member` cfgExternalCats cfg
|
isExternal c = c `Set.member` cfgExternalCats cfg
|
||||||
catsByPrefix = buildMultiMap [(takeWhile (/='_') cat, cat) | cat <- allCats cfg]
|
catsByPrefix = buildMultiMap [(takeWhile (/='_') cat, cat) | cat <- allCats cfg, not (isExternal cat)]
|
||||||
names = Map.fromList [(c,pref++"_"++show i) | (pref,cs) <- catsByPrefix, (c,i) <- zip cs [1..]]
|
names = Map.fromList [(c,pref++"_"++show i) | (pref,cs) <- catsByPrefix, (c,i) <- zip cs [1..]]
|
||||||
|
|
||||||
getSpeechLanguage :: PGF -> CId -> Maybe String
|
getSpeechLanguage :: PGF -> CId -> Maybe String
|
||||||
|
|||||||
Reference in New Issue
Block a user