Skip to content

Commit ac0f818

Browse files
author
Yifan Peng
authored
Merge pull request #22 from yfpeng/v2
v0.9.4
2 parents 7a2be81 + 16cd936 commit ac0f818

File tree

7 files changed

+30
-9
lines changed

7 files changed

+30
-9
lines changed

environment2.7.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ dependencies:
1313
- ply=3.10
1414
- tqdm=4.19.5
1515
- nltk=3.2.4
16-
- pytest=3.1.3
1716
- pathlib2=2.3.3
1817
- numpy=1.15.4
1918
- jpype1=0.6.3

environment3.7.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: negbio3.7
2+
channels:
3+
- anaconda
4+
- conda-forge
5+
- auto
6+
dependencies:
7+
- python=3.7
8+
- docutils=0.14
9+
- docopt=0.6.2
10+
- pytest=4.2.0
11+
- networkx=2.2
12+
- ply=3.11
13+
- tqdm=4.31
14+
- nltk=3.4
15+
- numpy=1.16
16+
- jpype1=0.6.3
17+
- pip:
18+
- bioc==1.3.1
19+
- pystanforddependencies==0.3.1
20+
- bllipparser==2016.9.11
21+
- pymetamap==0.1

negbio/pipeline/cleanup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ def clean_sentences(document, sort_anns=False):
1212
try:
1313
for passage in document.passages:
1414
del passage.sentences[:]
15-
if sort_anns:
16-
id = 0
17-
for ann in sorted(passage.annotations, key=lambda ann: ann.get_total_location().offset):
15+
16+
if sort_anns:
17+
key_func = lambda ann: ann.get_total_location().offset
18+
id = 0
19+
for passage in document.passages:
20+
for ann in sorted(passage.annotations, key=key_func):
1821
ann.id = str(id)
1922
id += 1
2023
except:
2124
logging.exception("Cannot process %s", document.id)
2225
return document
23-

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ networkx==1.11
66
ply==3.10
77
tqdm==4.19.5
88
nltk==3.2.4
9-
pytest==3.1.3
109
bioc==1.1.dev3
1110
pystanforddependencies==0.3.1
1211
bllipparser==2016.9.11

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def run(self):
6363
# Versions should comply with PEP440. For a discussion on single-sourcing
6464
# the version across setup.py and the project code, see
6565
# https://packaging.python.org/en/latest/single_source_version.html
66-
version='0.9.3',
66+
version='0.9.4',
6767

6868
description='NegBio: a tool for negation and uncertainty detection',
6969
long_description=readme(),

tests/negbio/pipeline/test_parse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
from negbio.pipeline.parse import Bllip
44

55

6-
def test_parse():
6+
def test_Bllip():
77
b = Bllip()
88
t = b.parse('hello world!')
99
assert str(t) == '(S1 (S (NP (NN hello) (NN world) (NN !))))'
1010

1111

1212
if __name__ == '__main__':
1313
logging.basicConfig(level=logging.WARNING)
14-
test_parse()
14+
test_Bllip()
File renamed without changes.

0 commit comments

Comments
 (0)