We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In section 4.6, there is the following example:
>>> nltk.metrics.distance.__file__ '/usr/lib/python2.5/site-packages/nltk/metrics/distance.pyc'
This fails with Python 3.7.4.
>>> nltk.metrics.distance.__file__ Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'nltk' is not defined
Attempts to import and then expose fail as well:
>>> import nltk.metrics.distance >>> nltk.metrics.distance.__file__ Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'nltk.translate.metrics' has no attribute 'distance'
This code does produce a result:
>>> from nltk.metrics import distance >>> distance.__file__ '/home/pj/.pyenv/versions/nltkbook/lib/python3.7/site-packages/nltk/metrics/distance.py' >>> quit()
The reason for this behavior may be a side effect of this import in nltk/__init__.py
import
nltk/__init__.py
from nltk.translate import *
which brings nltk.translate.metrics in as nltk.metrics.
nltk.translate.metrics
nltk.metrics
>>> import nltk >>> nltk.metrics <module 'nltk.translate.metrics' from '/home/pj/.pyenv/versions/nltkbook/lib/python3.7/site-packages/nltk/translate/metrics.py'> >>> nltk.metrics.__file__ '/home/pj/.pyenv/versions/nltkbook/lib/python3.7/site-packages/nltk/translate/metrics.py'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In section 4.6, there is the following example:
This fails with Python 3.7.4.
Attempts to import and then expose fail as well:
This code does produce a result:
The reason for this behavior may be a side effect of this
import
innltk/__init__.py
which brings
nltk.translate.metrics
in asnltk.metrics
.The text was updated successfully, but these errors were encountered: