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
2
votes
1 answer

Adding Tenses to Variants on GF

On GF tutorial on variants construct it says to express variation on GF one of the following methods should be used. lin Delicious = {s = "delicious" | "exquisit" | "tasty"} ; lin Delicious = {s = variants {"delicious" ; "exquisit" ; "tasty"}} ; I…
2
votes
2 answers

Generating a Possession Genitive Case in GF

I checked the GF library for "’s" as in "My friend’s house", but I couldn't seem to find the right method to create such a relation. May someone guide me on this problem. Appreciate it
2
votes
1 answer

Generating a sentence with passive tense in GF without "to be"

I used Phrase to generate the sentence "Play a comedy movie hosted by BBC". mkPhr (mkVP( (mkV2 (mkV ("Play"))) (mkNP aSg_Det (mkCN (mkCN (mkN ("comedy"))) (mkSC (passiveVP …
2
votes
1 answer

Conversion of AppGer.gf and AppFre.gf to .Pgf not working

when trying to convert AppGer.gf and AppFre.gf to .Pgf, I am getting out of memory error. Any help would be much appreciated. Thanks in advance. Following is the snapshot of the code and error: $ make AppGer.pgf mkdir -p ./gfos && gf -s -make…
Deepak
  • 21
  • 2
1
vote
1 answer

Sentence-initial capitalization, lexing and GF

I know that, in the GF shell, I can use the command put_string along with the lexer lextext to convert a string into a list of tokens (which can then be parsed). This lexer “understands” punctuation and, crucially, it also converts what it thinks is…
1
vote
1 answer

Ordinal number plus superlative adjective

In the RGL, Ord is a type which represents either an ordinal number (in words or digits): mkOrd : Numeral -> Ord --“twenty-second” mkOrd : Digits -> Ord --“22nd” Or a superlative adjective: mkOrd : A -> Ord --“smallest” But not both. What…
1
vote
1 answer

Headless noun phrases

What’s the best way in the GF RGL to create noun phrases that do not contain a noun? This is possible in some languages such as German where you can have noun phrases like: “der schwarze” (‘the black one’) assuming the missing noun is masc sg “ein…
1
vote
1 answer

How to encode a noun with modifiers like "offset direction" in GF?

I doing my first steps with an GF application grammar. I wonder how I can encode a noun with noun modifiers like "offset direction" or "income tax" in GF. This link explains the constructions I am interested in: noun-modifiers I tried using mkCN : N…
M Soegtrop
  • 1,268
  • 2
  • 8
1
vote
1 answer

Conjunction for Verb Phrase on GF

Problem I'm trying to generate the sentence It's sunny on Monday and rainy on Tuesday on GF using RGL. I looked for a method to generate this sentence on the RGL page, but I couldn't find anything that might help with this. Checked Extend.gf on…
1
vote
2 answers

Records generate large size compiled files

I've created a record that contains different type of categories, but this caused GF to generate huge gfo files (150Mb) or even breaking down in some languages after compiling for more than 10 mins. My record only contains 9 elements (8 different…
1
vote
1 answer

Difference between VQ and V2Q

To output a verb phrase that has an object as a question, then as it seems RGL only offers two functions: VQ -> QS -> VP V2Q -> NP -> QS -> VP And in these two functions, the verb type was divided into two different categories. But the type V2Q has…
1
vote
0 answers

Using external non-Android Java library in Android: couldn't find .so file and so on

I'm trying to build a template Android app using Grammatical Framework's Java bindings (however, I don't think what Java code I'm using in particular actually matters. Let's just say I'm trying to use some external non-Android Java code in an…
harisont
  • 143
  • 1
  • 9
1
vote
1 answer

Syntax error when trying to use dependent types in GF

I'm trying to play with dependent types, but I've gotten stuck on a syntax error that I can't seem to find the cause for. It's on my first lin definition in the concrete syntax. For context, I've been reading Inari's embedded grammars tutorial, and…
1
vote
1 answer

Using Fractions in GF

I'm trying to add decimals and fractions of two digits into RGL while keeping the original singular/plural rules of the noun that comes after mkNumeral or mkDigits. I tried using multiple nouns as mkNP(mkCN (mkN("ein")) …
1
vote
1 answer

mkNP contain additional determiner in GF

I'm trying to output the following sentence in Italian un anno e mezzo where the sentence is a noun-phrase-list. My code: lin Sentence = mkUtt(mkNP (and_Conj) (mkNP (aSg_Det) (mkN("anno"))) (mkNP (mkN("mezzo"))) …