gf

Writing in the form of "One of XXX (plural)" in GF


I'm trying to generate the sentence One of my friends on GF using the GF library. I failed at finding the right method for constructing a prep after a numeral and on creating the relation of one of with the plural noun.

enter image description here

as the class of Noun Phrase shows, Numeral or Digits only have Common Noun or Noun after them.


Solution

  • CountNP

    There is a function for this in the Noun module, but unfortunately it's not in the RGL API. The function is CountNP:

    CountNP : Det -> NP -> NP ;    -- three of them, some of the boys
    

    To use it in your grammar, you need to open the module NounEng. The usual practice is to open non-API modules qualified: instead of open NounEng in { … }, we give it a shorthand, like N: open (N=NounEng) in { … }. Then in the body of the grammar, you need to write N.CountNP. Here's an example, you can copy and paste it into a file called Friend.gf.

    resource Friend = open SyntaxEng, LexiconEng, (N=NounEng) in {
      oper
        one_Det : Det = mkDet (mkNumeral n1_Unit) ;
    
        my_friends_NP : NP = mkNP (mkDet i_Pron pluralNum) friend_N ;
    
        friend : NP = N.CountNP one_Det my_friends_NP ;
    }
    

    Predet

    Other times when you want to modify an already existing NP, you can use the Predet category. Here are examples (you can paste them into the same file Friend.gf).

    -- The RGL includes some Predets, like all, most and only:
    all_friends : NP = mkNP all_Predet my_friends_NP ;
    most_friends : NP = mkNP most_Predet my_friends_NP ;
    only_friends : NP = mkNP only_Predet my_friends_NP ;