GrammaticalFramework/gf-core

PGF2 lacks some functions that are available in PGF

harisont opened this issue · 4 comments

Using GF from Haskell I noticed that PGF2 lacks various maybe-not-indispensable-but-certainly-useful functions that were (well, are) available in PGF.

For instance, under Generation in PGF2 there is only one function generateAll, while under Generation in PGF there are lot of options for generating sentences from specific templates, choosing specific depths and so on.
The same applies to other operations, such as linearization.

As PGF2 is more convenient for many things, and as using PGF and PGF2 together seems not to be the best way to use GF in Haskell development, I wonder: could these missing functions be easily added to PGF2, or are there specific reasons (like differences between the C and the Haskell runtime) why they have not been implemented?

I've been looking into how easy it would be to add some more generation functions to PGF2, for example generateFrom for generation from an expression template. I see there is no ready-to-use function in the C runtime for this, but could it be added relatively easily using the existing 'reasoner' code? Or would you say it requires some significant additions to support this?

The reasoner code supports only exhaustive generation and would not be easy to adapt for random generation.

Well I meant exhaustive generation from a template, as in:

> gt Pred (This ?) Boring
Pred (This Cheese) Boring
Pred (This Fish) Boring
...

Another option is to just adapt the generation code from the Haskell runtime. After all, the only primitive that you need for the generation is the function functionsByCat which is in the API.

Right, I did not think of this. Thanks!