Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Handful of fixes for 37 CFR 42 #357

Merged
merged 10 commits into from
Feb 26, 2017
Merged

Conversation

cmc333333
Copy link
Member

  • Bugfix for amendments which add a subpart which has sections with subparagraphs
  • Add a SUBPART preprocessor that accounts for a common issue in the XML
  • Fix amendment parsing to prioritize subpart additions over individual sections
  • Make sure notice changes are added in a consistent order (a new issue w/ subpart additions)
  • Add 37 CFR 42 (USPTO) as a regression test

cmc333333 and others added 10 commits February 17, 2017 20:46
Previously, we had tacked on the "parent_label" to _all_ subnodes of a subpart
addition. This led all of the nodes to be added at the section level, which
would not only be inaccurate, but lead to an explosion as we couldn't compare
sections (ints) with paragraphs (strings) when sorting.
The Federal Register notice XML often has little bugs; in this case:

```
<HD SOURCE="HED">
  PART 42—TRIAL PRACTICE BEFORE THE PATENT TRIAL AND APPEAL BOARD
</HD>
<SUBPART>
  <HD SOURCE="HED">Subpart A—Trial Practice and Procedure</HD>
</SUBPART>
<CONTENTS>
  <SECHD>Sec.</SECHD>
  <HD SOURCE="HD1">General</HD>
  <SECTNO>42.1</SECTNO>
  <SUBJECT>Policy.</SUBJECT>
  <SECTNO>42.2</SECTNO>
...
```

Should instead have the SUBPART tag inside the CONTENTS (as in "table of"):
```
<HD SOURCE="HED">
  PART 42—TRIAL PRACTICE BEFORE THE PATENT TRIAL AND APPEAL BOARD
</HD>
<CONTENTS>
  <SUBPART>
    <HD SOURCE="HED">Subpart A—Trial Practice and Procedure</HD>
    <SECHD>Sec.</SECHD>
    <HD SOURCE="HD1">General</HD>
    <SECTNO>42.1</SECTNO>
    <SUBJECT>Policy.</SUBJECT>
    <SECTNO>42.2</SECTNO>
...
```
In particular, we want it to fire only if a new subpart can't be found.
This replaces the use of single-keyed dictionaries with a namedtuple of label,
content. I think we should extend this further to represent the change action,
etc. w/ attributes, but wanted to limit the impact for now.

By using these objects (rather than combining dictionaries, we ensure a
consistent ordering.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.002%) to 91.92% when pulling c58c673 on cmc333333:320-final-37-42-fixes into 2278cb5 on eregs:master.

@cmc333333 cmc333333 merged commit d0bbfce into eregs:master Feb 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants