Skip to content

Commit

Permalink
Merge pull request #215 from jblake1965/developer_5-24-24
Browse files Browse the repository at this point in the history
Refactor eluciDoc.py, update README.md and pyproject.toml
  • Loading branch information
jblake1965 authored May 25, 2024
2 parents 5935ef9 + 74b744b commit 66aa30a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The general principle behind its function is subject-predicate sentence analysis
in the document, followed by a user-selected phrase. It is used in conjunction with Microsoft™ Office 365™
Word and Excel™ apps.
# How it works:
A .docx, .pdf or .txt file (with the path) is entered:
A .docx, .pdf or .txt file and path is entered (drag and drop work in the Windows terminal):

![file_input](https://github.com/jblake1965/eluciDoc/assets/100727736/c08d59a4-a019-4a42-b895-427a1815b474)

Expand Down Expand Up @@ -42,15 +42,17 @@ are added to the master list. The master list is then saved as a Word file that
run (as with Excel, note the location of the Word executable and adjust the path if it is not in the standard install location).
# External Dependencies and Licenses

| Name: | Version: | License: |
|--------------|----------|-------------------------------------------------------------------------|
| docx2python | 2.0.4 | [MIT](https://pypi.org/project/docx2python/) |
| textacy | 0.13.0 | [Apache 2.0](https://pypi.org/project/textacy/) |
| pyinputplus | 0.2.12 | [BSD](https://github.com/asweigart/pyinputplus/blob/master/LICENSE.txt) |
| python-docx | 0.8.11 | [MIT](https://github.com/atriumlts/python-docx/blob/master/LICENSE) |
| spacy | 3.4.1 | [MIT](https://pypi.org/project/spacy/) |
| pdfminer.six | 20220524 | [MIT/X](https://github.com/pdfminer/pdfminer.six/blob/master/LICENSE) |
| python-docx | 0.8.11 | [MIT](https://pypi.org/project/python-docx/) |
| Name: | Version: | License: |
|---------------|----------|-------------------------------------------------------------------------|
| docx2python | 2.10.1 | [MIT](https://pypi.org/project/docx2python/) |
| openpyxl | 3.1.2 | [MIT](https://pypi.org/project/openpyxl/) |
| pandas | 2.2.2 | [BSD](https://pypi.org/project/pandas/) |
| pdfminer.six | 20231228 | [MIT/X](https://github.com/pdfminer/pdfminer.six/blob/master/LICENSE) |
| python-docx | 1.1.2 | [MIT](https://github.com/atriumlts/python-docx/blob/master/LICENSE) |
| rich | 13.7.1 | [MIT](https://pypi.org/project/rich/) |
| spacy | 3.7.4 | [MIT](https://pypi.org/project/spacy/) |
| textacy | 0.13.0 | [Apache 2.0](https://pypi.org/project/textacy/) |

# Installation
It is strongly recommended that this package be installed in a virtual environment. The package is available at https://pypi.org/project/elucidoc/
and can be installed with ```pip install elucidoc``` .
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "elucidoc"
version = "2024.5.17"
version = "2024.5.25"
license = {file = "LICENSE.txt"}
description = "Screens legal and other texts for sentences and clauses containing user defined search phrases"
readme = "README.md"
Expand All @@ -16,7 +16,10 @@ classifiers = [
"License :: Other/Proprietary License"
]
keywords = ["legal", "text", "analysis"]
dependencies = ["docx2python==2.10.1", "openpyxl==3.1.2", "pandas==2.2.2", "pdfminer.six==20231228", "python-docx==1.1.2", "rich==13.7.1", "spacy==3.7.4", "textacy==0.13.0"]
dependencies = [
"docx2python==2.10.1", "openpyxl==3.1.2", "pandas==2.2.2", "pdfminer.six==20231228", "python-docx==1.1.2",
"rich==13.7.1", "spacy==3.7.4", "textacy==0.13.0"
]

[project.urls]
"Source Code" = "https://github.com/jblake1965/eluciDoc"
Expand Down
3 changes: 1 addition & 2 deletions src/elucidoc/eluciDoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@


global text, case_sensitive, search_phrase, search_phrase_list, master_list, sentences, party, target_File_path, \
result_filename
result_filename, result_file


def kwic(text, party):
global result_file
result = extract.kwic.keyword_in_context(text, keyword=party, window_width=80)
df = pandas.DataFrame(result, columns=['Left', 'Key', 'Right'])
pandas.set_option('display.max_rows', None)
Expand Down

0 comments on commit 66aa30a

Please sign in to comment.