8000 kraftwerk · apercis/stanford-corenlp-python@1516899 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1516899

Browse files
committed
kraftwerk
1 parent 25d2187 commit 1516899

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Produces a list with a parsed dictionary for each sentence:
5454
"CharacterOffsetEnd": "5",
55< 8000 /code>55
"Lemma": "hello",
5656
"PartOfSpeech": "JJ",
57-
"CharacterOffsetBegin": 0}}}]
57+
"CharacterOffsetBegin": "0"}}}]
5858

5959

6060
To use it in a regular script or to edit/debug, load the module instead:

server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ def parse_parser_results(text):
4747
# split into attribute-value list
4848
av = re.split("=| ", s)
4949
# make [ignore,ignore,a,b,c,d] into [[a,b],[c,d]]
50-
av = zip(*[av[2:][x::2] for x in (0, 1)])
51-
# save as attr-value dict, convert numbers into ints
52-
tmp['words'][av[1]] = dict(av)
50+
# and save as attr-value dict, convert numbers into ints
51+
tmp['words'][av[1]] = dict(zip(*[av[2:][x::2] for x in (0, 1)]))
5352
# the results of this can't be serialized into JSON?
53+
# av = zip(*[av[2:][x::2] for x in (0, 1)])
5454
# tmp['words'][av[1]] = dict(map(lambda x: (x[0], x[1].isdigit() and int(x[1]) or x[1]), av))
5555
state = 3
5656
elif state == 3:

0 commit comments

Comments
 (0)
0