Drasil
Drasil copied to clipboard
Using a Grammatical Framework
~As I was looking through converting the ShortName
type to Sentence
from a String
, I noticed that the ProperNoun
and CommonNoun
type constructors both take in a String
while a Phrase
uses a Sentence
. Should the first two constructors be changed to take Sentences
as well? For reference, the type of NP is shown below:~
data NP =
ProperNoun String PluralRule -- ^ Stores a proper noun and its pluralization.
| CommonNoun String PluralRule CapitalizationRule -- ^ Stores a common noun and its pluralization.
| Phrase Sentence PluralForm CapitalizationRule CapitalizationRule -- ^ Stores noun phrase and its pluralization.
Edit: The original issue has changed a little bit. Originally it was about using Strings
in NP
, but now it is probably closer to investigating the use of a grammatical framework within Drasil. See the below comments for more details.
All of this stuff really needs a much deeper rethink. Tweaking this a little bit is not likely to give us enough gain to be worth it.
If we're going to make changes here, one would be to move away from String
altogether. Another one, even more radical, would be to use something like grammatical framework for doing Sentence
. Its uses in [Alfa[(https://cth.altocumulus.org/~hallgren/Alfa/Tutorial/GFplugin.html) is nice, and in GFILF are quite intriguing.
Interestingly, there's a GF kernel for embedding GF into Jupyter notebooks! (And think the more up-to-date versions are on github ).
Okay, I see, that would be a nice feature to implement (and to have some real concept-level combinators). From my understanding, GF can make and read sentences with semantic meaning, which would be nice for creating and combining concepts. Would this be something that is reasonably doable, and would it go well with #2606? Would this replace the current NounPhrase type (or even NamedIdea)? It feels like it should be somewhere between those two.
It's certainly not a 2-3 day implementation job! But it might be reasonable nevertheless. It might be worth looking at the various things I linked to get a better idea of the scope. Actually using it properly might be (by far) the biggest chunk of the work.
There's probably some more pressing things that would help more immediately. Though feel free to poke around a bit, to see.
I tried to get the GF to compile following these download instructions on my Linux subsystem but I'm getting compilation errors. Forking the gf-code repo and running stack install
there seems to work though. I might try and have a look at the tutorial next week