Package Bio :: Module triefind
[hide private]
[frames] | no frames]

Module triefind

source code

Given a trie, find all occurrences of a word in the trie in a string.

Like searching a string for a substring, except that the substring is any word in a trie.

Functions:

This module is OBSOLETE. We encourage users to switch to alternative libraries implementing a trie data structure, for example pygtrie.

Functions [hide private]
 
match(string, trie)
Find longest key, or return None.
source code
 
match_all(string, trie)
Find and return a list of keys.
source code
 
find(string, trie)
Find all the keys in the trie that match anywhere in the string.
source code
 
find_words(string, trie)
Find all the keys in the trie that match full words in the string.
source code
Variables [hide private]
  DEFAULT_BOUNDARY_CHARS = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~\t...
  __package__ = 'Bio'
Function Details [hide private]

match(string, trie)

source code 

Find longest key, or return None.

Find the longest key in the trie that matches the beginning of the string.

match_all(string, trie)

source code 

Find and return a list of keys.

Find all the keys in the trie that matches the beginning of the string.

find(string, trie)

source code 

Find all the keys in the trie that match anywhere in the string.

Returns a list of tuples (key, start, end).

find_words(string, trie)

source code 

Find all the keys in the trie that match full words in the string.

Find all the keys in the trie that match full words in the string. Word boundaries are defined as any punctuation or whitespace.

Returns a list of tuples (key, start, end).


Variables Details [hide private]

DEFAULT_BOUNDARY_CHARS

Value:
'''!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~\t
\x0b\x0c\r '''