I am looking for structured data of Chinese grammar, however much might have been done. Specifically sentence-level grammar. 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   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" (even though this is an English example of a word morphology rule). 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. That demonstrates the point, that code would be a second-best option for structured data for Chinese, after structured data.

So my question is, has anyone compiled (even the start of) a list of sentence-level grammar rules for Chinese, 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.

The Chinese Grammar Wiki is an excellent first step in "structuring" Chinese sentence-level grammar rules. Now I'm looking if anyone has taken this further toward a structured form, either as code or data. For example, this could quickly become structured with enough effort.

enter image description here

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.

1 Answer 1


Hunspell is built for languages which use spaces between words. That makes it easy to get the individual words, then check the spelling or even existence of each word. In Python, if asentence is a string variable, just do:


to get a list of the separate words in asentence.

To find the words in Chinese is more difficult for a computer. This link may help. You can download MMSEG as a zip file. According to the author, this algorithm can reach 98% accuracy.

Going from the words to a grammatical analysis is then a completely different and daunting kettle of fish!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.