Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nltk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
nltk
Commits
964f92fb
Commit
964f92fb
authored
Feb 10, 2015
by
Long Thanh Duong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify to work with python3
parent
a65f5d9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
nltk/parse/transitionparser.py
+4
-5
No files found.
nltk/parse/transitionparser.py
View file @
964f92fb
...
@@ -6,6 +6,9 @@
...
@@ -6,6 +6,9 @@
# URL: <http://nltk.org/>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
# For license information, see LICENSE.TXT
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
tempfile
import
tempfile
import
pickle
import
pickle
import
os
import
os
...
@@ -16,8 +19,6 @@ import scipy.sparse as sparse
...
@@ -16,8 +19,6 @@ import scipy.sparse as sparse
import
numpy
as
np
import
numpy
as
np
from
sklearn.datasets
import
load_svmlight_file
from
sklearn.datasets
import
load_svmlight_file
from
sklearn
import
svm
from
sklearn
import
svm
from
nltk.parse
import
DependencyGraph
from
evaluate
import
DependencyEvaluator
class
Configuration
(
object
):
class
Configuration
(
object
):
...
@@ -41,9 +42,7 @@ class Configuration(object):
...
@@ -41,9 +42,7 @@ class Configuration(object):
"""
"""
# dep_graph.nodes contain list of token for a sentence
# dep_graph.nodes contain list of token for a sentence
self
.
stack
=
[
0
]
# The root element
self
.
stack
=
[
0
]
# The root element
self
.
buffer
=
range
(
self
.
buffer
=
list
(
range
(
1
,
len
(
dep_graph
.
nodes
)))
# The rest is in the buffer
1
,
len
(
dep_graph
.
nodes
))
# The rest is in the buffer
self
.
arcs
=
[]
# empty set of arc
self
.
arcs
=
[]
# empty set of arc
self
.
_tokens
=
dep_graph
.
nodes
self
.
_tokens
=
dep_graph
.
nodes
self
.
_max_address
=
len
(
self
.
buffer
)
self
.
_max_address
=
len
(
self
.
buffer
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment