Mini Shell
3
��]B$ � @ s@ d Z ddlmZ ddlZddlZG dd� d�ZG dd� d�ZdS )aC
pypwl: pure-python personal word list in the style of Enchant
==============================================================
This module provides a pure-python version of the personal word list
functionality found in the spellchecking package Enchant. While the
same effect can be achieved (with better performance) using the python
bindings for Enchant, it requires a C extension.
This pure-python implementation uses the same algorithm but without any
external dependencies or C code (in fact, it was the author's original
prototype for the C version found in Enchant).
� )�
generatorsNc @ sV e Zd ZdZf fdd�Zdd� Zdd� Zdd d
�Zdge_dd
� Z dd� Z
dd� ZdS )�Triez�Class implementing a trie-based dictionary of words.
A Trie is a recursive data structure storing words by their prefix.
"Fuzzy matching" can be done by allowing a certain number of missteps
when traversing the Trie.
c C s( d| _ i | _x|D ]}| j|� qW d S )NF)�_eos�_keys�insert)�selfZwords�w� r �/usr/lib/python3.6/pypwl.py�__init__; s
z
Trie.__init__c C s^ |dkrd| _ nJ|d }y| | }W n" tk
rF t� }|| |<