| Server IP : 54.37.205.81 / Your IP : 216.73.216.76 Web Server : nginx/1.22.1 System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64 User : debian ( 1000) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/nltk/__pycache__/ |
Upload File : |
�
T�ck � �8 � d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlZddlm
Z
ddlmZ dZddlmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZ dd lm Z n# e!$ r d
Ze"ZY nw xY wddl#m$Z$m%Z% ddl&m'Z' ddl(Z( G d
� d� � Z) G d� d� � Z* G d� d� � Z+ G d� de+� � Z, G d� de+� � Z- G d� de+� � Z. G d� de+� � Z/ G d� de+� � Z0 G d� de+� � Z1 G d� d e+� � Z2 G d!� d"e+� � Z3 G d#� d$e+� � Z4 G d%� d&e+� � Z5 G d'� d(e+� � Z6 G d)� d*e+� � Z7 G d+� d,e+� � Z8 G d-� d.� � Z9 G d/� d0� � Z: G d1� d2� � Z;d3� Z<d4� Z=d`d5�Z>d`d6�Z?d7� Z@dad9�ZAd:� ZBd;� ZCd<� ZDd=� ZE e9� � ZFeFjG ZGd>� ZHd?� ZId@� ZJeKdAk �rKddBlLmMZM eM� � ZNeN�O dCdDdEdFdG�H� � eN�O dIdJdKdLd
dM�N� � eN�O dOdPdQdLd
dR�N� � eN�O dSdTdUdLd
dV�N� � eN�O dWdXdYejP �Q dZ� � d[�\� � eN�R � � \ ZSZT e9eSjU �]� � ZVeTrEeTD ]@ZWeV�G eWeSjX eSjY eSjZ eSj[ �^� � Z\e\d
k r
eSj[ r dS �AdS eV�G eSjX eSjY eSjZ eSj[ �_� � dS dS )baH
The NLTK corpus and module downloader. This module defines several
interfaces which can be used to download corpora, models, and other
data packages that can be used with NLTK.
Downloading Packages
====================
If called with no arguments, ``download()`` will display an interactive
interface which can be used to download and install new packages.
If Tkinter is available, then a graphical interface will be shown,
otherwise a simple text interface will be provided.
Individual packages can be downloaded by calling the ``download()``
function with a single argument, giving the package identifier for the
package that should be downloaded:
>>> download('treebank') # doctest: +SKIP
[nltk_data] Downloading package 'treebank'...
[nltk_data] Unzipping corpora/treebank.zip.
NLTK also provides a number of "package collections", consisting of
a group of related packages. To download all packages in a
colleciton, simply call ``download()`` with the collection's
identifier:
>>> download('all-corpora') # doctest: +SKIP
[nltk_data] Downloading package 'abc'...
[nltk_data] Unzipping corpora/abc.zip.
[nltk_data] Downloading package 'alpino'...
[nltk_data] Unzipping corpora/alpino.zip.
...
[nltk_data] Downloading package 'words'...
[nltk_data] Unzipping corpora/words.zip.
Download Directory
==================
By default, packages are installed in either a system-wide directory
(if Python has sufficient access to write to it); or in the current
user's home directory. However, the ``download_dir`` argument may be
used to specify a different installation target, if desired.
See ``Downloader.default_download_dir()`` for more a detailed
description of how the default download directory is chosen.
NLTK Download Server
====================
Before downloading any packages, the corpus and module downloader
contacts the NLTK download server, to retrieve an index file
describing the available packages. By default, this index file is
loaded from ``https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/index.xml``.
If necessary, it is possible to create a new ``Downloader`` object,
specifying a different URL for the package index file.
Usage::
python nltk/downloader.py [-d DATADIR] [-q] [-f] [-k] PACKAGE_IDS
or::
python -m nltk.downloader [-d DATADIR] [-q] [-f] [-k] PACKAGE_IDS
� N)�md5)�ElementTreeT) �Button�Canvas�Entry�Frame�IntVar�Label�Menu�TclError�Tk)� showerror)�Table)�ShowTextF)� HTTPError�URLError)�urlopenc �R � e Zd ZdZ d
d�Zed� � � Zd� Zd � ZdS )�Packagea4
A directory entry for a downloadable package. These entries are
extracted from the XML index file that is downloaded by
``Downloader``. Each package consists of a single file; but if
that file is a zip file, then it can be automatically decompressed
when the package is installed.
N� �UnknownTc �D � || _ |p|| _ || _ || _ t |� � | _ t |� � | _ || _ || _ | | _ |
| _
|| _ || _ t j � |� d� � d � � d }t j � |||z � � | _ t'