eregs/regulations-parser — pull request #83 by cmc333333 (2013-07-19 16:30:26+00:00)
Title: Notice AMDPAR Parser

What I've been working on the past week. At it's core, this takes the AMDPAR text, tokenizes it into one of four elements, performs transforms on those tokens, then converts the result into a list of changes and how they changed (though not the content of the change).

Here's the flow:

1. Tokenize (grammar/amdpar.py + grammar/tokens.py) into Verb, Context, Paragraph, or TokenList
1. (notice/diff.py) Switch the order of all passive verbs (we want verb followed by direct object(s))
1. Convert any ambiguous Contexts into Paragraphs
1. Split TokenList into separate tokens
1. Apply the contexts; this should leave with a list of Verbs and Paragraphs
1. Convert that list (with a few special cases) into a list of diffs

This pull request isn't quite done -- I need to add some tests and clean some bits up, but I wanted to share it as early in the day as I could.