0

I am looking for structured data of English grammar, however much might have been done. Specifically sentence-level grammar (as opposed to word morphology rules, though finding structured data for both would be nice). By "structured data", I mean something more structured than grammar written in prose / natural language, ideally in a data format like JSON. Here is a hypothetical JSON data format for word morphology rules related to the English word "interconnected":

{
  name: 'ed',
  load: [
    { form: 'anchor', name: 'base', base: true },
    { form: 'pattern', name: 'consonant', test: 'consonant' },
    { form: 'anchor', head: false }
  ],
  save: [
    { name: 'base' },
    { name: 'consonant' },
    { text: 'ed' },
  ]
}

{
  name: 'inter',
  save: [
    { text: 'inter' },
    { name: 'self' }
  ]
}

{
  save: [
    { rule: 'inter' },
    { name: 'self' },
    { rule: 'ed' }
  ]
}

This is modeled after the Hunspell dictionaries, which are the main modern digital dictionaries used by OSes, browsers, etc.. The load takes a word from a dictionary and applies the rule to it. The save is the final generated word. So the ed rule says "base: true (meaning, read the first characters of the word), until the first consonant, where the consonant is the last letter. Then save the base + consonant + ed". The actual full Hunspell format entry is this:

SFX D Y 4
SFX D   0     d          e
SFX D   y     ied        [^aeiou]y
SFX D   0     ed         [^ey]
SFX D   0     ed         [aeiou]y

Sidemote: Hunspell's format is a lot more compact and human readable, but it's a nightmare to parse, so the above JSON is closer to how a computer would perhaps model it after parsing the Hunspell format rule. But that is beside the point.

This all just goes to show what I am looking for in terms of "structured data". JSON, XML, CSV, or some other data format would be perfect. The next best option is in raw code (which is pseudo-structured I would say, as it's better than natural language, but it's still hard to deal with and port to different places). This huge pealim code file is for generating Hebrew verbs. It demonstrates what "code" would look like that I'm describing. And this code implements the "double metaphone" algorithm (a spell-check algorithm for English which is based on phonetics), it shows some code for dealing with English. Both demonstrate the point, that code would be a second-best option for structured data for English, after structured data.

So my question is, has anyone compiled (even the start of) a list of sentence-level grammar rules for English, in structured data form, as described? Or if not in structured JSON/etc., then as code? And if not code, what is the remaining last best bet, ideally some natural language text on a website, instead of a PDF or physical book.

Mainly I am looking to build on top of it, and if nothing else, to gain inspiration on how to get started modeling sentence-level grammar rules in a structured way.

0

You must log in to answer this question.

Browse other questions tagged .