diff options
| author | krasimir <krasimir@chalmers.se> | 2016-05-10 17:11:39 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2016-05-10 17:11:39 +0000 |
| commit | 80a96b3a851c9af7635e31a95dc0d6edaa386051 (patch) | |
| tree | 798a222078e18ac7294254e014561e55e7febf23 /src/runtime/c/pgf/pgf.h | |
| parent | 3f0fe438cd37bd9f9ece835b6f3bc90ed5566110 (diff) | |
an API for oracles in the GF parser
Diffstat (limited to 'src/runtime/c/pgf/pgf.h')
| -rw-r--r-- | src/runtime/c/pgf/pgf.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/runtime/c/pgf/pgf.h b/src/runtime/c/pgf/pgf.h index 80cbe29f2..4a6199c6f 100644 --- a/src/runtime/c/pgf/pgf.h +++ b/src/runtime/c/pgf/pgf.h @@ -137,6 +137,31 @@ pgf_parse_with_heuristics(PgfConcr* concr, PgfCId cat, GuExn* err, GuPool* pool, GuPool* out_pool); +typedef struct PgfOracleCallback PgfOracleCallback; + +struct PgfOracleCallback { + bool (*predict) (PgfOracleCallback* self, + PgfCId cat, + GuString label, + size_t offset); + bool (*complete)(PgfOracleCallback* self, + PgfCId cat, + GuString label, + size_t offset); + PgfExprProb* (*literal)(PgfOracleCallback* self, + PgfCId cat, + GuString label, + size_t* poffset, + GuPool *out_pool); +}; + +PgfExprEnum* +pgf_parse_with_oracle(PgfConcr* concr, PgfCId cat, + GuString sentence, + PgfOracleCallback* oracle, + GuExn* err, + GuPool* pool, GuPool* out_pool); + typedef struct { PgfToken tok; PgfCId cat; |
