| 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/parse/__pycache__/ |
Upload File : |
�
T�c�k � �
� d dl mZ d dlmZ d dlmZ d dlmZmZm Z d dl
mZ d dlm
Z
e G d� d� � � � Z G d � d
� � Z G d� d� � Z G d
� d� � Zd� Zd� Zd� Zd� Zedk r e� � dS dS )� )�defaultdict)�total_ordering)�chain)�DependencyGrammar�DependencyProduction�ProbabilisticDependencyGrammar)�raise_unorderable_types��DependencyGraphc �B � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
S )�DependencySpanaT
A contiguous span over some part of the input string representing
dependency (head -> modifier) relationships amongst words. An atomic
span corresponds to only one word so it isn't a 'span' in the conventional
sense, as its _start_index = _end_index = _head_index for concatenation
purposes. All other spans are assumed to have arcs between all nodes
within the start and end indexes of the span, and one head index corresponding
to the head word for the entire span. This is the same as the root node if
the dependency structure were depicted as a graph.
c � � || _ || _ || _ || _ || _ |||t |� � f| _ t | j � � | _ d S �N) �_start_index�
_end_index�_head_index�_arcs�_tags�tuple�_comparison_key�hash�_hash)�self�start_index� end_index�
head_index�arcs�tagss �G/usr/lib/python3/dist-packages/nltk/parse/projectivedependencyparser.py�__init__zDependencySpan.__init__( sT � �'���#���%�����
���
� +�Y�
�E�$�K�K�P����$�.�/�/��
�
�
� c � � | j S )zk
:return: An value indexing the head of the entire ``DependencySpan``.
:rtype: int
)r �r s r r zDependencySpan.head_index1 s
� �
��r! c �0 � d| j | j | j fz S )zj
:return: A concise string representatino of the ``DependencySpan``.
:rtype: str.
�Span %d-%d; Head Index: %d)r r r r# s r �__repr__zDependencySpan.__repr__8 s'