Skip to content

Commit

Permalink
Allow relative import
Browse files Browse the repository at this point in the history
  • Loading branch information
amir-zeldes committed May 26, 2020
1 parent 5903850 commit 8d35903
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ Either install from PyPI using pip:

`pip install hebpipe`

And run as a module:

`python -m hebpipe example_in.txt`

Or install manually:

* Clone this repository into the directory that the script should run in (git clone https://github.com/amir-zeldes/HebPipe)
Expand Down
26 changes: 19 additions & 7 deletions hebpipe/heb_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@
from glob import glob

from rftokenizer import RFTokenizer
from lib.xrenner import Xrenner
from lib._version import __version__
from lib.tt2conll import conllize
from lib.append_column import inject_col
from lib.sent_split import toks_to_sents
from lib.whitespace_tokenize import tokenize as whitespace_tokenize
try: # Module usage
from .lib.xrenner import Xrenner
from .lib._version import __version__
from .lib.tt2conll import conllize
from .lib.append_column import inject_col
from .lib.sent_split import toks_to_sents
from .lib.whitespace_tokenize import tokenize as whitespace_tokenize
except ImportError: # direct script usage
from lib.xrenner import Xrenner
from lib._version import __version__
from lib.tt2conll import conllize
from lib.append_column import inject_col
from lib.sent_split import toks_to_sents
from lib.whitespace_tokenize import tokenize as whitespace_tokenize


PY3 = sys.version_info[0] > 2

Expand Down Expand Up @@ -617,7 +626,10 @@ def run_hebpipe():
dotok = opts.tokenize

if not opts.quiet:
from lib import timing
try:
from .lib import timing
except ImportError: # direct script usage
from lib import timing

files = glob(opts.files)

Expand Down
2 changes: 1 addition & 1 deletion hebpipe/lib/_version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

__version__ = "1.0.0.1"
__version__ = "1.0.0.2"
__author__ = "Amir Zeldes"
__copyright__ = "Copyright 2018-2020, Amir Zeldes"
__license__ = "Apache 2.0 License"
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
setup(
name = 'hebpipe',
packages = find_packages(),
version = '1.0.0.1',
version = '1.0.0.2',
description = 'A pipeline for Hebrew NLP',
author = 'Amir Zeldes',
author_email = 'amir.zeldes@georgetown.edu',
package_data = {'':['README.md','LICENSE.md','requirements.txt'],'hebpipe':['lib/*','data/*','bin/*','models/*']},
install_requires=['numpy','pandas','scipy','joblib','xgboost==0.81','rftokenizer','depedit','xmltodict'],
url = 'https://github.com/amir-zeldes/HebPipe',
license='Apache License, Version 2.0',
download_url = 'https://github.com/amir-zeldes/HebPipe/releases/tag/v1.0.0.1',
download_url = 'https://github.com/amir-zeldes/HebPipe/releases/tag/v1.0.0.2',
keywords = ['NLP', 'Hebrew', 'segmentation', 'tokenization', 'tagging', 'parsing','morphology','POS'],
classifiers = ['Programming Language :: Python',
'Programming Language :: Python :: 2',
Expand Down

0 comments on commit 8d35903

Please sign in to comment.