Skip to content

Commit

Permalink
Merge pull request #21 from akb89/develop
Browse files Browse the repository at this point in the history
linted code + updated urls
  • Loading branch information
akb89 authored Nov 2, 2020
2 parents ae4a5bd + fc4c152 commit ceff928
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 110 deletions.
29 changes: 0 additions & 29 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ stages:
- test
- lint

build:python3.5:
image: python:3.5
stage: build
script: python setup.py -q install

build:python3.6:
image: python:3.6
stage: build
Expand All @@ -18,11 +13,6 @@ build:python3.7:
stage: build
script: python setup.py -q install

test:python3.5:
image: python:3.5
stage: test
script: pip install pytest pytest-cov && python -m pytest --cov=pyfn tests/

test:python3.6:
image: python:3.6
stage: test
Expand All @@ -33,11 +23,6 @@ test:python3.7:
stage: test
script: pip install pytest pytest-cov && python -m pytest --cov=pyfn tests/

lint:python3.5:
image: python:3.5
stage: lint
script: pip install pylint && pylint pyfn

lint:python3.6:
image: python:3.6
stage: lint
Expand All @@ -48,17 +33,3 @@ lint:python3.7:
stage: lint
script: pip install pylint && pylint pyfn

docstyle:python3.5:
image: python:3.5
stage: lint
script: pip install pydocstyle && pydocstyle pyfn

docstyle:python3.6:
image: python:3.6
stage: lint
script: pip install pydocstyle && pydocstyle pyfn

docstyle:python3.7:
image: python:3.7
stage: lint
script: pip install pydocstyle && pydocstyle pyfn
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,19 @@ parser, please create an [issue](https://github.com/akb89/pyfn/issues) on Github
To run the preprocessing and frame semantic parsing scripts, first download:
- `data.7z` containing all the FrameNet splits for FN 1.5 and FN 1.7
```shell
wget http://129.194.21.122/~kabbach/pyfn/data.7z
wget backup.3azouz.net/pyfn/data.7z
```
- `lib.7z` containing all the different external softwares (taggers, parsers, etc.)
```shell
wget http://129.194.21.122/~kabbach/pyfn/lib.7z
wget backup.3azouz.net/pyfn/lib.7z
```
- `resources.7z` containing all the required resources
```shell
wget http://129.194.21.122/~kabbach/pyfn/resources.7z
wget backup.3azouz.net/pyfn/resources.7z
```
- `scripts.7z` containing the set of bash scripts to call the different parsers and preprocessing toolkits
```shell
wget http://129.194.21.122/~kabbach/pyfn/scripts.7z
wget backup.3azouz.net/pyfn/scripts.7z
```

Extract the content of all the archives under a
Expand Down
7 changes: 3 additions & 4 deletions pyfn/marshalling/marshallers/semafor.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ def _get_token_num(index, text):
if char.isspace():
prev_char_is_whitespace = True
continue
else:
if prev_char_is_whitespace:
token_num += 1
prev_char_is_whitespace = False
if prev_char_is_whitespace:
token_num += 1
prev_char_is_whitespace = False
if char_index == index:
return token_num
raise Exception('Could not determine token number for char index '
Expand Down
5 changes: 2 additions & 3 deletions pyfn/marshalling/unmarshallers/bios.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ def _get_labelstore(lines, tokens, text, labelstore):
label.end = marsh_utils.get_end_index(
int(iline_split[0])-1, tokens, text)
continue
else:
labelstore.labels.append(label)
return _get_labelstore(lines[lines.index(iline):],
labelstore.labels.append(label)
return _get_labelstore(lines[lines.index(iline):],
tokens, text, labelstore)
labelstore.labels.append(label)
return labelstore
Expand Down
6 changes: 3 additions & 3 deletions pyfn/marshalling/unmarshallers/framenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def _unmarshall_fulltext_xml(xml_file_path, fe_dict, flatten=False):
const.FN_XML_NAMESPACE))
except XMLProcessingError as err:
raise XMLProcessingError('Could not process XML file: {}. Cause: {}'
.format(xml_file_path, str(err)))
.format(xml_file_path, str(err))) from err
sentence_tags = root.findall('fn:sentence', const.FN_XML_NAMESPACE)
for sentence_tag in sentence_tags:
annosets = extract_fn_annosets(
Expand Down Expand Up @@ -385,7 +385,7 @@ def _get_fe_dict(frame_xml_filepaths):
fe_dict[frame_element._id] = frame_element
except XMLProcessingError as err:
raise XMLProcessingError('Could not process XML file: {}. Cause: {}'
.format(frame_xml_filepath, str(err)))
.format(frame_xml_filepath, str(err)))from err
return fe_dict


Expand Down Expand Up @@ -506,5 +506,5 @@ def extract_relations(fr_relation_xml_filepath):
fe_relations.append(fe_relation)
except XMLProcessingError as err:
raise XMLProcessingError('Could not process XML file: {}. Cause: {}'
.format(fr_relation_xml_filepath, str(err)))
.format(fr_relation_xml_filepath, str(err))) from err
return frame_relations, fe_relations
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
author_email='akb@3azouz.net',
long_description=long_description,
long_description_content_type='text/markdown',
version='1.3.7',
version='1.3.11',
url='https://gitlab.com/akb89/pyfn',
download_url='https://pypi.org/project/pyfn/#files',
license='MIT',
Expand Down Expand Up @@ -48,7 +48,6 @@
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
Expand Down
65 changes: 0 additions & 65 deletions tests/test_utils_immutables.py

This file was deleted.

0 comments on commit ceff928

Please sign in to comment.