| 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 : /lib/python3/dist-packages/nltk/parse/__pycache__/ |
Upload File : |
�
T�c�{ � �� � d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m
Z
ddlmZ G d� d � � Z
dd�Z G d� d
e� � Zd� Zdd�Zd� Zd� Zd� ZdZdZdZedk r e� � dS dS )z�
Tools for reading and writing dependency trees.
The input is assumed to be in Malt-TAB format
(https://stp.lingfil.uu.se/~nivre/research/MaltXML.html).
� N)�defaultdict)�chain)�pformat)�find_binary)�Treec �� � e Zd ZdZ d d�Zd� Zd� Zd� Zd � Zd
� Z d� Z
d� Zd
� Zd� Z
d� Ze d!d�� � Zd� Zd� Zd� Z d"d�Zd#d�Zd� Zd� Zd$d�Zd� Zd� Zd� Zd� Zd� Zd� ZdS )%�DependencyGraphzQ
A container for the nodes and labelled edges of a dependency structure.
NF�ROOTc �� � t d� � � | _ | j d � dddd�� � d| _ |r| � |||||�� � dS dS )a� Dependency graph.
We place a dummy `TOP` node with the index 0, since the root node is
often assigned 0 as its head. This also means that the indexing of the
nodes corresponds directly to the Malt-TAB format, which starts at 1.
If zero-based is True, then Malt-TAB-like input with node numbers
starting at 0 and the root node assigned -1 (as produced by, e.g.,
zpar).
:param str cell_separator: the cell separator. If not provided, cells
are split by whitespace.
:param str top_relation_label: the label by which the top relation is
identified, for examlple, `ROOT`, `null` or `TOP`.
c
�>