| 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�z � �� � d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm Z d dl
mZ d dlm
Z
d dlmZ n# e$ r Y nw xY wd d lmZmZmZ G d
� d� � Z G d� d
� � Z G d� de� � Zd� ZdS )� N)�deepcopy)�
itemgetter)�remove)�array)�sparse)�svm)�load_svmlight_file)�DependencyEvaluator�DependencyGraph�ParserIc �, � e Zd ZdZd� Zd� Zdd�Zd� ZdS ) �
Configurationa
Class for holding configuration which is the partial analysis of the input sentence.
The transition based parser aims at finding set of operators that transfer the initial
configuration to the terminal configuration.
The configuration includes:
- Stack: for storing partially proceeded words
- Buffer: for storing remaining input words
- Set of arcs: for storing partially built dependency tree
This class also provides a method to represent a configuration as list of features.
c �� � dg| _ t t dt |j � � � � � � | _ g | _ |j | _ t | j � � | _ dS )z�
:param dep_graph: the representation of an input in the form of dependency graph.
:type dep_graph: DependencyGraph where the dependencies are not specified.
r � N) �stack�list�range�len�nodes�buffer�arcs�_tokens�_max_address)�self� dep_graphs �=/usr/lib/python3/dist-packages/nltk/parse/transitionparser.py�__init__zConfiguration.__init__( sX � � �S��
��5��C� ��$8�$8�9�9�:�:����� � �������,�,����� c � � dt | j � � z dz t | j � � z dz t | j � � z S )NzStack : z Buffer : z
Arcs : )�strr r r )r s r �__str__zConfiguration.__str__4 sR � ���$�*�o�o�
��
� �$�+���
� �
�
�$�)�n�n�
�
r Fc �6 � |�dS |dk rdS |du r|dk rdS dS )zs
Check whether a feature is informative
The flag control whether "_" is informative or not
NF� �_T� )r �feat�flags r �_check_informativez Configuration._check_informative>