top of page
  • Writer's pictureKJ Ha

The Fox and the Grapes

The Fox and the Grapes is an interactive sentence generator using a Context-Free Grammar. As the title suggested, an Aesop's fable of the same name is taken as a source text. All words appear in the generated sentences are retrieved from the source text, after being processed through RiTa library's RiTa.getPosTags function. The rules to generate patterns of strings were set based on parts of speech tag returned by RiTa.getPosTags function. If there are the words, "fox" or "grapes", in the generated sentence, the corresponding emoji, 🦊 and 🍇, will appear at the end of the sentence.

The sketch is developed on Daniel Shiffman's example.

The font used in the sketch is "kindergarten", a freely downloadable font from .

Link to the web app:


bottom of page