Creating Unicode identifiers - lexical error

23 views
Skip to first unread message

Belal

unread,
Feb 20, 2021, 11:07:35 PM2/20/21
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

unread,
Feb 20, 2021, 11:17:25 PM2/20/21
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 https://github.com/GrammaticalFramework/gf-rgl/blob/master/src/estonian/DictEst.gf 
lin
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'.

Cheers,
Inari


--

---
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/gf-dev/571f49f3-8d64-49ad-a14c-48f085310e08n%40googlegroups.com.

Belal

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

Best regards,
Belal

Reply all
Reply to author
Forward
0 new messages