Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PGF2 lacks some functions that are available in PGF #131

Open
harisont opened this issue Aug 17, 2021 · 4 comments
Open

PGF2 lacks some functions that are available in PGF #131

harisont opened this issue Aug 17, 2021 · 4 comments

Comments

@harisont
Copy link
Member

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?

@krangelov
Copy link
Member

krangelov commented Aug 17, 2021 via email

@johnjcamilleri
Copy link
Member

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?

@krangelov
Copy link
Member

krangelov commented Aug 24, 2021 via email

@johnjcamilleri
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants