Skip to content

Commit

Permalink
initial 0.1.9 release commit
Browse files Browse the repository at this point in the history
  • Loading branch information
reddalexx committed Jul 3, 2018
1 parent b6df9a0 commit 1997efd
Show file tree
Hide file tree
Showing 103 changed files with 703 additions and 228 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -111,3 +111,6 @@ ENV/
.mypy_cache/

benchmarks
lexnlp/extract/en/contracts/data/*.model
/.pytest_cache/

1 change: 1 addition & 0 deletions MANIFEST.in
Expand Up @@ -2,6 +2,7 @@ include README.md
include python-requirements.txt
recursive-include lexnlp *.pickle
recursive-include lexnlp/extract/en/addresses *.json *.txt *.xml
recursive-include lexnlp/extract/en/contracts *.model.part.*
recursive-include lexnlp *.csv
recursive-include libs *
recursive-include scripts *
4 changes: 2 additions & 2 deletions lexnlp/__init__.py
Expand Up @@ -2,9 +2,9 @@
import os

__author__ = "ContraxSuite, LLC; LexPredict, LLC"
__copyright__ = "Copyright 2015-2017, ContraxSuite, LLC"
__copyright__ = "Copyright 2015-2018, ContraxSuite, LLC"
__license__ = "https://github.com/LexPredict/lexpredict-lexnlp/blob/master/LICENSE"
__version__ = "0.1.8"
__version__ = "0.1.9"
__maintainer__ = "LexPredict, LLC"
__email__ = "support@contraxsuite.com"

Expand Down
4 changes: 2 additions & 2 deletions lexnlp/config/__init__.py
@@ -1,6 +1,6 @@
__author__ = "ContraxSuite, LLC; LexPredict, LLC"
__copyright__ = "Copyright 2015-2017, ContraxSuite, LLC"
__copyright__ = "Copyright 2015-2018, ContraxSuite, LLC"
__license__ = "https://github.com/LexPredict/lexpredict-lexnlp/blob/master/LICENSE"
__version__ = "0.1.8"
__version__ = "0.1.9"
__maintainer__ = "LexPredict, LLC"
__email__ = "support@contraxsuite.com"
4 changes: 2 additions & 2 deletions lexnlp/config/en/__init__.py
@@ -1,6 +1,6 @@
__author__ = "ContraxSuite, LLC; LexPredict, LLC"
__copyright__ = "Copyright 2015-2017, ContraxSuite, LLC"
__copyright__ = "Copyright 2015-2018, ContraxSuite, LLC"
__license__ = "https://github.com/LexPredict/lexpredict-lexnlp/blob/master/LICENSE"
__version__ = "0.1.8"
__version__ = "0.1.9"
__maintainer__ = "LexPredict, LLC"
__email__ = "support@contraxsuite.com"
4 changes: 2 additions & 2 deletions lexnlp/config/en/company_types.py
Expand Up @@ -13,9 +13,9 @@


__author__ = "ContraxSuite, LLC; LexPredict, LLC"
__copyright__ = "Copyright 2015-2017, ContraxSuite, LLC"
__copyright__ = "Copyright 2015-2018, ContraxSuite, LLC"
__license__ = "https://github.com/LexPredict/lexpredict-lexnlp/blob/master/LICENSE"
__version__ = "0.1.8"
__version__ = "0.1.9"
__maintainer__ = "LexPredict, LLC"
__email__ = "support@contraxsuite.com"

Expand Down
4 changes: 2 additions & 2 deletions lexnlp/config/en/geoentities_config.py
Expand Up @@ -3,9 +3,9 @@
"""

__author__ = "ContraxSuite, LLC; LexPredict, LLC"
__copyright__ = "Copyright 2015-2017, ContraxSuite, LLC"
__copyright__ = "Copyright 2015-2018, ContraxSuite, LLC"
__license__ = "https://github.com/LexPredict/lexpredict-lexnlp/blob/master/LICENSE"
__version__ = "0.1.8"
__version__ = "0.1.9"
__maintainer__ = "LexPredict, LLC"
__email__ = "support@contraxsuite.com"

Expand Down
4 changes: 2 additions & 2 deletions lexnlp/config/stanford.py
Expand Up @@ -6,9 +6,9 @@
from lexnlp import get_lib_path

__author__ = "ContraxSuite, LLC; LexPredict, LLC"
__copyright__ = "Copyright 2015-2017, ContraxSuite, LLC"
__copyright__ = "Copyright 2015-2018, ContraxSuite, LLC"
__license__ = "https://github.com/LexPredict/lexpredict-lexnlp/blob/master/LICENSE"
__version__ = "0.1.8"
__version__ = "0.1.9"
__maintainer__ = "LexPredict, LLC"
__email__ = "support@contraxsuite.com"

Expand Down
4 changes: 2 additions & 2 deletions lexnlp/extract/__init__.py
@@ -1,6 +1,6 @@
__author__ = "ContraxSuite, LLC; LexPredict, LLC"
__copyright__ = "Copyright 2015-2017, ContraxSuite, LLC"
__copyright__ = "Copyright 2015-2018, ContraxSuite, LLC"
__license__ = "https://github.com/LexPredict/lexpredict-lexnlp/blob/master/LICENSE"
__version__ = "0.1.8"
__version__ = "0.1.9"
__maintainer__ = "LexPredict, LLC"
__email__ = "support@contraxsuite.com"
4 changes: 2 additions & 2 deletions lexnlp/extract/en/__init__.py
@@ -1,6 +1,6 @@
__author__ = "ContraxSuite, LLC; LexPredict, LLC"
__copyright__ = "Copyright 2015-2017, ContraxSuite, LLC"
__copyright__ = "Copyright 2015-2018, ContraxSuite, LLC"
__license__ = "https://github.com/LexPredict/lexpredict-lexnlp/blob/master/LICENSE"
__version__ = "0.1.8"
__version__ = "0.1.9"
__maintainer__ = "LexPredict, LLC"
__email__ = "support@contraxsuite.com"
2 changes: 1 addition & 1 deletion lexnlp/extract/en/addresses/address_features.py
Expand Up @@ -15,7 +15,7 @@
from dateutil import parser as dateparser

__author__ = "ContraxSuite, LLC; LexPredict, LLC"
__copyright__ = "Copyright 2015-2017, ContraxSuite, LLC"
__copyright__ = "Copyright 2015-2018, ContraxSuite, LLC"
__license__ = "https://github.com/LexPredict/lexpredict-lexnlp/blob/master/LICENSE"
__version__ = "0.1.6"
__maintainer__ = "LexPredict, LLC"
Expand Down
2 changes: 1 addition & 1 deletion lexnlp/extract/en/addresses/addresses.py
Expand Up @@ -12,7 +12,7 @@
from lexnlp.extract.en.addresses import address_features

__author__ = "ContraxSuite, LLC; LexPredict, LLC"
__copyright__ = "Copyright 2015-2017, ContraxSuite, LLC"
__copyright__ = "Copyright 2015-2018, ContraxSuite, LLC"
__license__ = "https://github.com/LexPredict/lexpredict-lexnlp/blob/master/LICENSE"
__version__ = "0.1.6"
__maintainer__ = "LexPredict, LLC"
Expand Down
2 changes: 1 addition & 1 deletion lexnlp/extract/en/addresses/tests/test_addresses.py
Expand Up @@ -2,7 +2,7 @@
from lexnlp.tests import lexnlp_tests

__author__ = "ContraxSuite, LLC; LexPredict, LLC"
__copyright__ = "Copyright 2015-2017, ContraxSuite, LLC"
__copyright__ = "Copyright 2015-2018, ContraxSuite, LLC"
__license__ = "https://github.com/LexPredict/lexpredict-lexnlp/blob/master/LICENSE"
__version__ = "0.1.6"
__maintainer__ = "LexPredict, LLC"
Expand Down
4 changes: 2 additions & 2 deletions lexnlp/extract/en/amounts.py
Expand Up @@ -35,9 +35,9 @@
from num2words import num2words

__author__ = "ContraxSuite, LLC; LexPredict, LLC"
__copyright__ = "Copyright 2015-2017, ContraxSuite, LLC"
__copyright__ = "Copyright 2015-2018, ContraxSuite, LLC"
__license__ = "https://github.com/LexPredict/lexpredict-lexnlp/blob/master/LICENSE"
__version__ = "0.1.8"
__version__ = "0.1.9"
__maintainer__ = "LexPredict, LLC"
__email__ = "support@contraxsuite.com"

Expand Down
57 changes: 30 additions & 27 deletions lexnlp/extract/en/citations.py
Expand Up @@ -12,9 +12,9 @@
from reporters_db import EDITIONS, REPORTERS

__author__ = "ContraxSuite, LLC; LexPredict, LLC"
__copyright__ = "Copyright 2015-2017, ContraxSuite, LLC"
__copyright__ = "Copyright 2015-2018, ContraxSuite, LLC"
__license__ = "https://github.com/LexPredict/lexpredict-lexnlp/blob/master/LICENSE"
__version__ = "0.1.8"
__version__ = "0.1.9"
__maintainer__ = "LexPredict, LLC"
__email__ = "support@contraxsuite.com"

Expand Down Expand Up @@ -44,28 +44,31 @@ def get_citations(text, return_source=False, as_dict=False) -> Generator:

for source_text, volume, reporter, page, page2, court, year\
in CITATION_PTN_RE.findall(text):
reporter_data = REPORTERS[EDITIONS[reporter]]
reporter_full_name = ''
if len(reporter_data) == 1:
reporter_full_name = reporter_data[0]['name']
elif year:
for period_data in reporter_data:
if reporter in period_data['editions']:
start = period_data['editions'][reporter]['start'].year
end = period_data['editions'][reporter]['end']
if (end and start <= int(year) <= end.year) or start <= int(year):
reporter_full_name = period_data['name']
item = (int(volume),
reporter,
reporter_full_name,
int(page),
page2 or None,
court.strip(', ') or None,
int(year) if year.isdigit() else None)
if return_source:
item += (source_text.strip(),)
if as_dict:
keys = ['volume', 'reporter', 'reporter_full_name',
'page', 'page2', 'court', 'year', 'citation_str']
item = {keys[n]: val for n, val in enumerate(item)}
yield item
try:
reporter_data = REPORTERS[EDITIONS[reporter]]
reporter_full_name = ''
if len(reporter_data) == 1:
reporter_full_name = reporter_data[0]['name']
elif year:
for period_data in reporter_data:
if reporter in period_data['editions']:
start = period_data['editions'][reporter]['start'].year
end = period_data['editions'][reporter]['end']
if (end and start <= int(year) <= end.year) or start <= int(year):
reporter_full_name = period_data['name']
item = (int(volume),
reporter,
reporter_full_name,
int(page),
page2 or None,
court.strip(', ') or None,
int(year) if year.isdigit() else None)
if return_source:
item += (source_text.strip(),)
if as_dict:
keys = ['volume', 'reporter', 'reporter_full_name',
'page', 'page2', 'court', 'year', 'citation_str']
item = {keys[n]: val for n, val in enumerate(item)}
yield item
except KeyError:
pass

0 comments on commit 1997efd

Please sign in to comment.