Comments (4)
You can use variants, as defined here. Here's a dummy sketch, just to give a rough idea:
lin
-- Assume apple and fruit are { s : Number => Str }
TypeOf apple fruit = { s = variants {
apple.s ! Pl ++ "are a type of" ++ fruit.s ! Sg ;
apple.s ! Pl ++ "are a kind of" ++ fruit.s ! Sg ;
apple.s ! Pl ++ "are" ++ fruit.s ! Pl }
} ;
from gf.
Ah yes thanks I saw that! But I'm using the resource grammar library. I think I can do with the |
operator like this:
Pet = mkCN ((mkN "cat") | (mkN "dog")) ;
from gf.
Using the RGL or not, doesn't matter: you can write anything inside the variants. This is another dummy example, check the RGL API synopsis for the actual mkX
you want.
TypeOf apple fruit = mkS (mkCl apple type_N fruit | mkCl apple kind_N fruit | mkCl apple fruit) ;
Should be the same as
TypeOf apple fruit = variants {
mkS (mkCl apple type_N fruit) ;
mkS (mkCl apple kind_N fruit) ;
mkS (mkCl apple fruit) } ;
from gf.
Amazing thanks!
from gf.
Related Issues (20)
- Resource API for Turkish
- Various issues with running the RGL test suite
- A command for asserting linearizations HOT 1
- Difficulties understanding Pattern Matching HOT 11
- Some translations are very slow.
- Crash while switching between languages. HOT 4
- README for iOS sample app missing HOT 3
- Int vs Integer
- Decouple outdated SQLite3 Btree dependency HOT 1
- Could not find module ‘SG’ and ‘PGF2’ while building HOT 1
- Could not find module ‘SG’ and ‘PGF2’ while building
- GF as additional source in Cabal sandbox gives error about sdist
- should the `vars` oper be added to the Prelude? HOT 2
- How to create android specific .pgf_c binary ? HOT 9
- Conversion of AppGer.gf and AppFre.gf to .Pgf not working HOT 10
- To get the code for writing input text files to excel file
- Splitting GF into separate repositories HOT 3
- Polarity being parsed but not showing up in trees HOT 1
- Parsing arbitrary numbers HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gf.