mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
in PGFService disambiguation, show tree if there's no disamb grammar
This commit is contained in:
@@ -157,9 +157,13 @@ doTranslateGroup pgf input mcat mfrom mto =
|
|||||||
disamb lg from t =
|
disamb lg from t =
|
||||||
if lg < 2
|
if lg < 2
|
||||||
then []
|
then []
|
||||||
else [("tree", "-- " ++ doText (doBind (PGF.linearize pgf (disambLang from) t)))]
|
else [("tree", "-- " ++ doText (doBind (disambLang from t)))]
|
||||||
|
|
||||||
|
disambLang f t = let disf = PGF.mkCId ("Disamb" ++ PGF.showLanguage f) in
|
||||||
|
if elem disf (PGF.languages pgf)
|
||||||
|
then PGF.linearize pgf disf t
|
||||||
|
else PGF.showExpr [] t
|
||||||
|
|
||||||
disambLang f = maybe f id $ PGF.readLanguage $ "Disamb" ++ PGF.showLanguage f
|
|
||||||
notDisamb = (/="Disamb") . take 6 . PGF.showLanguage
|
notDisamb = (/="Disamb") . take 6 . PGF.showLanguage
|
||||||
|
|
||||||
doParse :: PGF -> String -> Maybe PGF.Type -> Maybe PGF.Language -> JSValue
|
doParse :: PGF -> String -> Maybe PGF.Type -> Maybe PGF.Language -> JSValue
|
||||||
|
|||||||
Reference in New Issue
Block a user