1
0
forked from GitHub/gf-core

fix the callback for unknown words as well

This commit is contained in:
krasimir
2015-02-18 16:47:33 +00:00
parent a97dee067a
commit f3797bb313

View File

@@ -544,10 +544,11 @@ nerc pgf (lang,concr) lin_idx sentence offset =
chunk :: LiteralCallback
chunk _ (_,concr) lin_idx sentence offset =
case uncapitalized (drop offset sentence) of
Just (word@(_:_),rest) | null (lookupMorpho concr word) ->
Just (expr,0,length sentence-length rest)
Just (word0@(_:_),rest) | null (lookupMorpho concr word) ->
Just (expr,0,offset+length word)
where
expr = mkApp "MkSymb" [mkStr (trimRight word)]
word = trimRight word0
expr = mkApp "MkSymb" [mkStr word]
_ -> Nothing