Questions tagged [gf]

GF, Grammatical Framework, is a programming language for multilingual grammar applications.

GF, Grammatical Framework, is a programming language for multilingual grammar applications. It is

  • a special-purpose language for grammars, like YACC, Bison, Happy, BNFC, but not restricted to programming languages
  • a functional language, like Haskell, Lisp, OCaml, Scheme, SML, but specialized to grammar writing
  • a natural language processing framework, like LKB, XLE, Regulus, but based on functional programming and type theory
  • a categorial grammar formalism, like ACG, CCG, but different and equipped with different tools
  • a logical framework, like Agda, Coq, Isabelle, but equipped with concrete syntax in addition to logic

http://www.grammaticalframework.org/

45 questions
5
votes
1 answer

Grammatical Framework: "linearization type field cannot be Int"; how to write a concrete syntax for grammar with arithmetic expressions?

I'm trying to write a concrete syntax for this grammar (from Chapter 6 in Grammatical Framework: Programming with Multilingual Grammars): abstract Arithm = { flags startcat = Prop ; cat Prop ; -- proposition Nat ; …
inariksit
  • 1,232
  • 7
  • 13
5
votes
2 answers

Grammatical framework GF and owl

I am interested in the filed on Computational Linguistics and NLP. I read a lot about Grammatical Framework (GF), which is divided into abstract syntax and concrete syntax. And I know a little bit about OWL, RDF and WordNet. I am confused about the…
Eng Katy
  • 51
  • 1
3
votes
1 answer

What is the meaning of alias "@" in GF?

I have encountered alias sign inside RGL in this operation: mkRoot3 : Str -> Root3 = \fcl -> case fcl of { f@? + c@? + l => {f = f ; c = c ; l = l} ; _ => error ("mkRoot3: too short root" ++ fcl) } ; What does it mean, and…
3
votes
1 answer

How to install the RGL for the latest version of GF?

May I please ask you how to install the RGL for the latest version of GF on Mac OS system? I have tried to follow the GFSS2021 courses, but I didn't find the solution. Hi,Inariksit, I just tried these methods in Github, but I failed, I chose to run…
Yang Hua
  • 31
  • 2
3
votes
1 answer

How to trace Grammatical Framework parse: example WordNet imports badly

I am trying to use WordNetEng concrete grammar https://github.com/GrammaticalFramework/gf-wordnet which, as I understand - uses all the standard grammar features (from the GF base installation), but greatly expands lexicon. My GF installation is…
TomR
  • 2,696
  • 6
  • 34
  • 87
3
votes
3 answers

Variants fails to compile on GF

I build a program to generate different verbs from one Imperative tree. the abstract file: abstract Test = { flags startcat = Utterance; cat Utterance; Imperative; Verb; VerbPhrase; fun -- verb phrase Play_VP…
2
votes
1 answer

French partitive ‘de’

What is the best way in the GF RGL to represent the thing that French grammar books usually call the “partitive article” (du, de la, des)? Examples: Je voudrais de l'eau I would like some water Il y a du vin ici There is some wine here The…
2
votes
1 answer

How do I make a quantifier-less ordinal determiner?

If I have a cardinal number, the RGL allows me to create a determiner from it with or without a quantifier: mkDet : Quant -> Card -> Det --these five mkDet : Card -> Det --five If I have an ordinal number, the RGL only allows me to create…
2
votes
1 answer

Implement custom library browser / type hierarchy in an Eclipse plugin

I'm creating an Eclipse Plugin for development using the Grammatical Framework (GF), and once of the major features I want to implement a custom "library browser" for searching the GF Resource Grammar Library (which will internally involve parsing a…
John J. Camilleri
  • 4,171
  • 5
  • 31
  • 41
2
votes
1 answer

Compute concrete in PGF

I have these two files that run perfectly fine within GF shell My GF code Test.gf abstract Test = { cat Sentence; Noun; fun MySentence : Noun -> Sentence; } TestEng.gf concrete TestEng of Test = open SyntaxEng, ParadigmsEng,…
2
votes
1 answer

Interpreting a cliff edge in GHC heap profiles

I need some help understanding some GHC heap profiles. I'm working on a new output format for an existing compiler for the Grammatical Framework language. Before Profiling a normal run of the current version of the compiler looks like this: …
John J. Camilleri
  • 4,171
  • 5
  • 31
  • 41
2
votes
1 answer

Subjunctive mood in Spanish in GF

What is the correct grammar tree in GF for generating sentences in Spanish: a) that contain subjunctive mood. b) which the subject is a sentence too. an example: me gusta que mi jefe no trabaje hoy
2
votes
1 answer

random phrase generation and gender/human agreement in English

I am trying to generate random practice phrases in English for a morse code trainer. I am trying to figure out how to deal with gender agreement in English. I'd like to be able to generate phrases like "He is a son", "She is a mother", "It is a…
stepcut
  • 1,502
  • 8
  • 10
2
votes
1 answer

Spanish verbs with NP in GF

Running the code below generates sell it to me when using English files from RGL. But changing the library files to Spanish gives this output vende &+ lo me where on the other hand the correct output should be something like this véndeme…
2
votes
1 answer

The relative clause (which) in GF

"Play Toy Story which was published last year" Sentence = mkUtt( mkImp (mkVP (mkV2 "play") (mkNP (mkCN (mkCN (mkN "Toy Story")) (mkS pastTense simultaneousAnt(mkCl (mkVP …
1
2 3