1
0
forked from GitHub/gf-core

Merge remote-tracking branch 'upstream/master' into por

This commit is contained in:
odanoburu
2018-04-14 19:22:01 -03:00
3 changed files with 8 additions and 6 deletions

View File

@@ -1236,6 +1236,7 @@ pgf_new_parse_state(PgfParsing* ps, size_t start_offset,
PgfLexiconIdxEntry* entry = gu_buf_extend(state->lexicon_idx); PgfLexiconIdxEntry* entry = gu_buf_extend(state->lexicon_idx);
entry->idx = seq->idx; entry->idx = seq->idx;
entry->offset = state->start_offset; entry->offset = state->start_offset;
entry->sym_idx= 0;
} }
// Add non-epsilon lexical rules to the bottom up index // Add non-epsilon lexical rules to the bottom up index

View File

@@ -542,7 +542,7 @@ parseWithHeuristics :: Concr -- ^ the language with which we parse
-- If a literal has been recognized then the output should -- If a literal has been recognized then the output should
-- be Just (expr,probability,end_offset) -- be Just (expr,probability,end_offset)
-> ParseOutput -> ParseOutput
parseWithHeuristics lang (Type ctype _) sent heuristic callbacks = parseWithHeuristics lang (Type ctype touchType) sent heuristic callbacks =
unsafePerformIO $ unsafePerformIO $
do exprPl <- gu_new_pool do exprPl <- gu_new_pool
parsePl <- gu_new_pool parsePl <- gu_new_pool
@@ -550,6 +550,7 @@ parseWithHeuristics lang (Type ctype _) sent heuristic callbacks =
sent <- newUtf8CString sent parsePl sent <- newUtf8CString sent parsePl
callbacks_map <- mkCallbacksMap (concr lang) callbacks parsePl callbacks_map <- mkCallbacksMap (concr lang) callbacks parsePl
enum <- pgf_parse_with_heuristics (concr lang) ctype sent heuristic callbacks_map exn parsePl exprPl enum <- pgf_parse_with_heuristics (concr lang) ctype sent heuristic callbacks_map exn parsePl exprPl
touchType
failed <- gu_exn_is_raised exn failed <- gu_exn_is_raised exn
if failed if failed
then do is_parse_error <- gu_exn_caught exn gu_exn_type_PgfParseError then do is_parse_error <- gu_exn_caught exn gu_exn_type_PgfParseError

View File

@@ -1,13 +1,13 @@
name: pgf2 name: pgf2
version: 0.1.0.0 version: 0.1.0.0
-- synopsis: -- synopsis:
-- description: -- description:
homepage: http://www.grammaticalframework.org homepage: http://www.grammaticalframework.org
license: LGPL-3 license: LGPL-3
--license-file: LICENSE --license-file: LICENSE
author: Krasimir Angelov, Inari author: Krasimir Angelov, Inari
maintainer: maintainer:
-- copyright: -- copyright:
category: Language category: Language
build-type: Simple build-type: Simple
extra-source-files: README extra-source-files: README
@@ -20,7 +20,7 @@ library
other-modules: PGF2.FFI, PGF2.Expr, PGF2.Type, SG.FFI other-modules: PGF2.FFI, PGF2.Expr, PGF2.Type, SG.FFI
build-depends: base >=4.3, build-depends: base >=4.3,
containers, pretty containers, pretty
-- hs-source-dirs: -- hs-source-dirs:
default-language: Haskell2010 default-language: Haskell2010
build-tools: hsc2hs build-tools: hsc2hs