Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
126 views
in Technique[技术] by (71.8m points)

Constant not found: overload in GF

I was trying to make an overload of function that I have created on GF, but after using the overload function I keep getting this error message. enter image description here

Am I using this function of GF incorrectly or is there is any new update to this functionality.

Here is what I was trying to do

Sentence = sentence(mkN(“random”));

oper

sentence:overload {

sentence:N-> Utt =


oun->

mkUtt(mkNP(noun));

sentence:V-> Utt =

 verb->

mkutt(mkImp(mkV2(verb)));

};


Thank you~

question from:https://stackoverflow.com/questions/65934032/constant-not-found-overload-in-gf

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It looks like your code is a snippet, so there may be a few things preventing your grammar from compiling.

To start, if you check the documentation, you can see that there are two forms for overloading operations.

You are using the syntax to give the types to define the operations. Instead, you should use this existing code with the syntax for defining the operations.

oper sentence = overload {...} ;

The syntax that you are using should be used to define your types before you make the overload oper.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...