8000 Fixed bug which caused weird issues with quotes in numeric values. · Libardo1/stanford-corenlp-python@b664532 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit b664532

Browse files
committed
Fixed bug which caused weird issues with quotes in numeric values.
1 parent 8593c0a commit b664532

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

corenlp/corenlp.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import pexpect
2828
import tempfile
2929
import shutil
30+
import re
3031
from progressbar import ProgressBar, Fraction
3132
from unidecode import unidecode
3233
from subprocess import call
@@ -187,6 +188,8 @@ def parse_parser_results(text):
187188
split_entry = re.split("\(|, |-", line[:-1])
188189
if len(split_entry) == 5:
189190
rel, left, leftindex, right, rightindex = split_entry
191+
leftindex = re.sub("[^0-9]", "", leftindex)
192+
rightindex = re.sub("[^0-9]", "", rightindex)
190193
sentence['dependencies'].append(tuple([rel, left, leftindex, right, rightindex]))
191194

192195
elif state == STATE_COREFERENCE:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
AUTHOR = "Hiroyoshi Komatsu, Dustin Smith, Aditi Muralidharan"
77
AUTHOR_EMAIL = "aditi.shrikumar@gmail.com"
88
URL = "https://github.com/Wordseer/stanford-corenlp-python"
9-
VERSION = "3.3.0-0"
9+
VERSION = "3.3.2-0"
1010

1111
setup(
1212
name=NAME,

0 commit comments

Comments
 (0)
0