a Parser for legal case citions.

caseciteparser的Python项目详细描述


关于

法律案件引证的分析器。

安装

通过运行:

pip install caseciteparser

用法

caseciteparser中有两个面向用户的函数:parse_tokens(words)parse_string(string)

parse_tokens(words)解析以空格分隔的标记列表并返回一个dict列表,其中列表中的每个项都对应于单词标记列表中的一个法律案例引用。

parse_string(string)通过调用parse_tokens(string.split())解析字符串。

示例

    >>> from caseciteparser import parse_string
>>> from pprint import pprint

>>> pprint(parse_string("Mydlach v. DaimlerChrysler Corp., 226 Ill. 2d 307, 311, 875 N.E.2d 1047 (2007)."))
[{'case_first_page': '307',
  'cite_string': '226 Ill. 2d 307, 311, 875 N.E.2d 1047 (2007).',
  'cite_type': 'full_cite',
  'date_paren_string': '2007',
  'end_index': 12,
  'pincite': '311',
  'reporter': 'Ill. 2d',
  'start_index': 4,
  'stringcites': [{'case_first_page': '1047',
                   'reporter': 'N.E.2d',
                   'volume': '875'}],
  'volume': '226',
  'year': '2007'}]

>>> pprint(parse_string("Charlesworth v. Mack, 727 F. Supp. 1407, 1412 (D. Mass. 1990)."))
[{'case_first_page': '1407',
  'cite_string': '727 F. Supp. 1407, 1412 (D. Mass. 1990).',
  'cite_type': 'full_cite',
  'court_jursidiction': 'Mass.',
  'court_type': 'D.',
  'date_paren_string': 'D. Mass. 1990',
  'end_index': 10,
  'pincite': '1412',
  'reporter': 'F. Supp.',
  'start_index': 3,
  'volume': '727',
  'year': '1990'}]

>>> pprint(parse_string("Youngstown, 343 U.S. at 585."))
[{'cite_string': '343 U.S. at 585.',
  'cite_type': 'short_cite',
  'end_index': 4,
  'pincite': '585',
  'reporter': 'U.S.',
  'start_index': 1,
  'volume': '343'}]

>>> pprint(parse_string("Although Illinois law recognizes limitation periods as valid contractual provisions in an \
 insurance contract, see, e.g., Affiliated FM Insurance Co. v. Board of Education, 23 F.3d 1261, 1264 (7th Cir. \
 1994) (and cases cited therein), section 143.1 of the Code is an important statutory restriction on such \
 limitation provisions, Hines v. Allstate Insurance Co., 298 Ill. App. 3d 585, 588, 698 N.E.2d 1120 (1998)."))
[{'case_first_page': '1261',
  'cite_string': '23 F.3d 1261, 1264 (7th Cir. 1994)',
  'cite_type': 'full_cite',
  'court_jursidiction': '7th',
  'court_type': 'Cir.',
  'date_paren_string': '7th Cir. 1994',
  'end_index': 30,
  'pincite': '1264',
  'reporter': 'F.3d',
  'start_index': 24,
  'volume': '23',
  'year': '1994'},
 {'case_first_page': '585',
  'cite_string': '298 Ill. App. 3d 585, 588, 698 N.E.2d 1120 (1998).',
  'cite_type': 'full_cite',
  'date_paren_string': '1998',
  'end_index': 63,
  'pincite': '588',
  'reporter': 'Ill. App. 3d',
  'start_index': 54,
  'stringcites': [{'case_first_page': '1120',
                   'reporter': 'N.E.2d',
                   'volume': '698'}],
  'volume': '298',
  'year': '1998'}]

许可证/归属

本项目是在GNU Affero通用公共许可下授权的,附加条件是,如果您将其用于学术研究并导致论文发表,则您应提供本项目的归属。有关许可证的实际条款,请参见许可证文件。

联系人

如果您有任何问题或意见,请随时给我发邮件,甚至让我知道您是如何使用案例资源的!我真的很想看看人们对判例法的自动化分析在做什么!

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在TextView中对齐部分文本   带有iText和eTPKCS11的java PKCS#11签名。dll&SunPKCS11提供程序   java Intellij Idea找不到jar   java Chrome/Firefox和Jetty HTTPS   java我无法打包找不到的JavaFX应用程序模块   多线程Java:排序从异步任务检索的结果   java客户端/服务器socket不能与外部连接一起工作   java如何在单击“下一步”按钮时获取其他详细信息?   java组织。springframework。网状物客户RestTemplate应声明为@Bean,而plain@Autowired抛出错误   java如何绘制javax。摆动将ImageIcon转换为JavaFX。fxml呈现用户界面?   使用for循环的Java跟踪   java如何编码字符串以显示彩色文本(基于字符串中的前缀)   Java保存/打开文件对象   基于java复选框的搜索:使用尽可能多的“”动态生成准备好的语句作为选中复选框的计数   java为什么crawler4j随机挂起?