Created
May 29, 2014 20:12
-
-
Save krusynth/d9e48447cd2fff58de83 to your computer and use it in GitHub Desktop.
State Decoded parser for San Francisco's Charter for American Legal data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* San Francisco parser for State Decoded. | |
* Extends AmericanLegal base classes. | |
* | |
* PHP version 5 | |
* | |
* @license http://www.gnu.org/licenses/gpl.html GPL 3 | |
* @version 0.8 | |
* @link http://www.statedecoded.com/ | |
* @since 0.3 | |
*/ | |
/** | |
* This class may be populated with custom functions. | |
*/ | |
require 'class.AmericanLegal.inc.php'; | |
class State extends AmericanLegalState {} | |
class Parser extends AmericanLegalParser | |
{ | |
/* | |
* Regexes. | |
*/ | |
// | type of section |!temp!| | section number (opt ' - section number') | | hyphen | catch line | |
public $section_regex = '/^\[?((?P<type>SEC(TION|S\.|\.)|APPENDIX|ARTICLE)\s+)?(?P<number>[0-9A-Z]+[0-9A-Za-z_\.\-]*(.?\s-\s[0-9]+[0-9A-Za-z\.\-]*)?)\.?\s*(?:-\s*)?(?P<catch_line>.*?)\.?\]?$/i'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment