Re: [GF] Erros:Happened in the renaming of NPPlace,mkNPDay! Help !!!

68 views
Skip to first unread message

Aarne Ranta

unread,
May 9, 2013, 2:14:04 AM5/9/13
to gf-...@googlegroups.com
Hello Charles,

It's great to hear that you are writing a Chinese Phrasebook! The errors you get happen in the renaming phase of compilation, which is when the compiler finds out the modules where constants come from. Two kinds of things can go wrong here:

- a constant is not found in any module that is imported. This is an error and stops compilation. Example:

Happened in the renaming of ByFoot
   constant not found: mkAv

- a constant is found in more than one module. This is a warning, and may result in errors later. Example:

Happened in the renaming of ByFoot
   Warning: atomic term mkAdv
            conflict ParadigmsEng.mkAdv, ConstructorsEng.mkAdv


So the question is: what is the full message you get? The line after "Happened in the renaming of..." tells you what exactly the error is.

Regards

  Aarne.






On Thu, May 9, 2013 at 4:13 AM, haojun xiong <haojun.x...@gmail.com> wrote:
Dear All,
    Recently I've been implementing the Chinese part in the phrasebook(GF-master/examples/phrasebook) based on Chinese resource grammar library . I've written four files included GreetingChi.gf,SentencesChi.gf,WordsChi.gf,PhrasebookChi.gf.   
   When I use the terminal  to try to compile these languages by the command "make" to produce Phrasebook.pgf  ,it shows that
   gf -make -s -optimize-pgf -name=PhrasebookChi PhrasebookChi.gf +RTS -K32M
/home/charles/Documents/phrasebook/SentencesI.gf:187-191:
   Happened in the renaming of mkNPDay

/home/charles/Documents/phrasebook/SentencesI.gf:45:
Happened in the renaming of Transport

/home/charles/Documents/phrasebook/SentencesI.gf:44:
Happened in the renaming of ByTransport

and at last

  gf: PhrasebookChi.pgf: openBinaryFile: does not exist (No such file or directory)

Now I try to use different ways to rewrite the file WordChi.gf at least three times, but unfortunately it shows the same errors "Happend in the renaming of ..." 
  This is my dissertation ,I've benn  puzzled about this problems for  two months . Now I don't know how to solve this kind of error. Did someone have a similar problem  once ?  
  I'm looking forward to somebody's reply! It's really urgent for me.

Best Regards 
Charles Xiong
  






   

--
 
---
You received this message because you are subscribed to the Google Groups "Grammatical Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gf-dev+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

haojun xiong

unread,
May 15, 2013, 11:04:02 PM5/15/13
to gf-...@googlegroups.com, aa...@chalmers.se
 Thanks for your reply.Forgive me for not replying you in time,I am sorry.
     Yeah,the lines after "Happend in the renaming of Date(Transport/ByTransport/NPDay/NPPlace/NPDay/mkNPDay)"   all show the same message

   " Warning : atmoic term Adv 
             conflict CatChi.gf,CommonX.gf
             given ....
    "
  then I do some research about Adv in the GF resource grammar library
        CommonX.gf :  
               Adv ={s: Str}
        CatEng.gf inherits CommonX
        CatChi.gf :   
               Adv = {s : Str ; advType : AdvType} 
 
        ResChi.gf :  AdvType ,which is defined in ResChi  is a parametric type.
               param   AdvType = ATPlace | ATTime | ATManner ;
                              -- e.g.
                                              in the house  房子里 
                                             on Monday     在星期一
                                             by Bus        坐公交车

       ParadigmsChi.gf :
                 AdvType : Type = ResChi.AdvType ;
                 placeAdvType : AdvType= ATPlace ;
                 timeAdvType : AdvType = ATTime ;
                 mannerAdvType : AdvType= ATManner ;
               
                mkAdv = overload {
                       mkAdv : Str -> Adv 
                                  = \s -> lin Adv {s = word s ; advType = ATPlace} ;
                       mkAdv : Str -> AdvType -> Adv 
                                  = \s,at -> lin Adv {s = word s ; advType = at} ;  } ;
    
      Constructors.gf  : there are different implementations of mkAdv  
                 
In the folder phrasebook(GF-master/examples/phrasebook)
      SentencesI.gf :
        lincat
            Date =Adv ;
            ByTransport =Adv;
            Transport ={name:CN ;by :Adv};
        oper
            NPDay :Type={name:NP;point :Adv;habitual :Adv} ;
            
            mkNPDay : NP->Adv->Adv ->NPDay =\d,p,h ->{
                   name=d; point =p; habitual=h };

            NPPlace :Type ={name:NP ;at :Adv; to :Adv};

All warnings  seems to be related to Adv definitions in Chinese grammar ,which is different from that in other languages 

I just know the solutions but I don't know how to write 
        I can write Date ,Transport and so on in SentencesChi.gf  just like that  "
    concrete SentencesChi of Sentences = NumeralChi ** SentencesI - [
             Date,ByTransport,Transport,
             NPDay,NPPlace,mkNPDay ] with 
            (Syntax = SyntaxChi),
            (Symbolic = SymbolicChi),
            (Lexicon = LexiconChi) ** open SyntaxChi, (P = ParadigmsChi), (R = ResChi) in {
              flags coding=utf8 ;
    lincat
         Date = ;
         ByTransport =;
         Transport=;
    oper 
         NPDay :Tpye=;
         mkNPDay: ;
        NPPlace: ;
}
 "

So my problem now is how to implement these lincats or operations when it is connected with Chinese adverbial phrases(Adv). 
Actually I am not familiar with Chinese grammar . It just make me confused .  I had to say that "Oh,it's really a tough time for me". 
   Looking forward to your kind reply. 

Regards 
  Charles



在 2013年5月9日星期四UTC+8下午2时14分04秒,Aarne Ranta写道:

Aarne

unread,
May 20, 2013, 2:52:58 AM5/20/13
to gf-...@googlegroups.com, aa...@chalmers.se
Hello Charles,

I guess it is the Adv of Chinese resource grammar you want to have. You can achieve this by writing SyntaxChi.Adv.

However, I see there is a special problem here, having to do with the use of a functor SentenceI. It resolves Adv as CommonX.Adv, which works for other languages than Chinese, because their Syntax uses CommonX.Adv. Why it does this, we must find out. But there is an easy fix: annotate every Adv in SentencesI as Syntax.Adv. I have done this and pushed the patch to darcs. If you don't use darcs, you can still get the new version of SentenceI.gf from http://www.grammaticalframework.org/examples/phrasebook/

Having done this, I almost manage to compile SentenceChi as a pure functor instantiation (similar to SentencesEng). But an error with lock_NP remains in two oper's. I can resolve this by overriding these oper's. Again, it would need further investigation why these errors arise - but here is a quick fix: replace the pure functor instantiation by the following:

-----------------------------------------

concrete SentencesChi of Sentences = NumeralChi ** SentencesI - [ThePlace,APlace]

with 
  (Syntax = SyntaxChi),
  (Symbolic = SymbolicChi),
  (Lexicon = LexiconChi) 
** open SyntaxChi in {

lin
    ThePlace kind = let dd = theSg_Det 
                     in placeNP dd kind ;
    APlace kind = let dd = theSg_Det 
                     in placeNP dd kind ;

---------------------------------

It works if you only have singular names for places (the only exception in the whole Phrasebook is French "les toilettes"). 

Regards

  Aarne.

haojun xiong

unread,
May 21, 2013, 10:17:39 PM5/21/13
to gf-...@googlegroups.com, aa...@chalmers.se
Yes,Thanks you very much!  I try  to implement other functors to see if there  is something wrong . It's so grateful 

在 2013年5月20日星期一UTC+8下午2时52分58秒,Aarne写道:
Reply all
Reply to author
Forward
0 new messages