Menard
A Clojure library for generation and parsing expressions from grammars and lexicons.
Install / Use
/learn @ekoontz/MenardREADME
Menard
A Clojure library for generation and parsing of natural language expressions.
Acknowledgements
All errors in the code are my fault, not anyone's cited here.
HPSG
Based on a linguistic theory called HPSG (Head Driven Phrase Structure Grammar). More about HPSG:
- http://hpsg.stanford.edu/
- https://en.wikipedia.org/wiki/Head-driven_phrase_structure_grammar
[Fehringer 1999]
Dutch grammar and lexicon based on Carole Fehringer, "A Reference Grammar of Dutch", Cambridge University Press, 1999, referred to here as "F. <section>" or "F. pp. <pages>".
[Oosterhoff 2009]
Dutch grammar and lexicon based on Janneke Oosterhoff, "Basic Dutch: A Grammar and Workbook", 2009, referred to here as "O. Unit <unit> Note <note>".
Verbix
Uses verb conjugations from Verbix: http://www.verbix.com
Demo
For the demo, a Dutch sentence and a semantically-equivalent* English sentence. First the Dutch sentence is generated (for each specification listed in <a href="https://github.com/ekoontz/menard/blob/master/src/menard/nederlands/expressions.edn">expressions.edn</a>), then, the semantics of this Dutch sentence are used to generate an English sentence with the same* semantics.
* Approximately the same semantics, modulo various bugs and misunderstandings on my part.
$ ./src/scripts/demo.sh
The output will look like this example, although you'll get your own, uniquely-generated set of sentences.
License
Copyright © 2018 Eugene Koontz
Distributed under the Eclipse Public License, the same as Clojure.
Please see the epl-v10.html file at the top level of this repo.
Name
The story Pierre Menard, autor del Quijote, by Jorge Luis Borges, tells of a writer, Pierre Menard, who attempted to rewrite Cervantes' Don Quixote, not simply by copying it letter-by-letter from the original text, but rather by somehow reproducing the mental and experiential state of Cervantes that was necessary to write it, and then writing it de novo from that state. I see this as reminicent of this project's attempt to generate natural language expressions by encoding semantic representations and then using grammar rules and lexical entries that are able to generate the expressions from the semantic representations.
Initially, I named this project babel, after another of Borges' stories, The Library of Babel, but this name is already taken by a well-known Javascript tool. I later rewrote and simplified the same ideas in my 'babel' project into a new github repository, calling it 'babylon', before discovering that this name was also already a well-known Javascript software project. Now I have arrived at the current name, by renaming the 'babylon' repository to 'menard'.
I've found that there is another project called pierre-menard, also as it happens written in Clojure, that is now archived with the last commit being 2012, so I think it is safe to reappropriate this name for my own project now in 2020.
Inspirations
Besides the above-mentioned linguistics and Borges references mentioned above, I am including some links below which I think are interesting and related to the ideas I am exploring here.
Related Skills
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
best-practices-researcher
The most comprehensive Claude Code skills registry | Web Search: https://skills-registry-web.vercel.app
groundhog
400Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
last30days-skill
20.0kAI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
