Creating Unicode identifiers - lexical error

Skip to first unread message


Feb 20, 2021, 11:07:35 PMFeb 20
to Grammatical Framework
Hello everyone,

My name is Belal. This is my first post in GF group. I am an Arabic second language educator and native speaker,  and I am looking into GF as a option for creating interactive Arabic teaching and learning resources for the web. 

I have been experimenting with GF - and so far so good. It looks very promising for the specific application domain that I have in mind. 

When I tried creating identifiers with only Arabic characters, I keep getting a "lexical error" when compiling the grammar. When changing the identifier to something in English, the error goes away and it compiles fine. 

My .gf files are in UTF-8 encoding (I manually checked this) and I added the "-coding" pragma to the top of the file containing the Arabic identifier:

--# -coding=utf8

 as per this link:

Is there anything I missed? Please advise. Thanks!

- Belal

Inari Listenmaa

Feb 20, 2021, 11:17:25 PMFeb 20
to Grammatical Framework
Hi Belal,

without seeing your code, my guess is that you need to put the fun and lin names inside single quotes ''. You can see examples e.g. in the Estonian dictionary module 
aabitsatarkus_N = mkN "aabitsa" (mkN "tarkus" "tarkuse" "tarkust" "tarkusesse" "tarkuste" "tarkusi") ;
'aabitsatõde_N' = mkN "aabitsa" (mkN "tõde" "tõe" "tõde" "tõesse" "tõdede" "tõdesid") ;
The first identifier has only ASCII characters so it's written without quotes, but the second one has õ, so it's wrapped in single quotes. So it should work to just define identifiers like  'خدم_V'.



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
To view this discussion on the web visit


Feb 21, 2021, 2:10:41 AMFeb 21
to Grammatical Framework
The single quotes did the trick!! Thanks Inari!

Best regards,

Reply all
Reply to author
0 new messages