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

Module Bio.triefind

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: match Find longest key in a trie matching the beginning of the string. match_all Find all keys in a trie matching the beginning of the string. find Find keys in a trie matching anywhere in a string. find_words Find keys in a trie matching whole words in a string.
Function Summary
  find(string, trie)
find(string, trie) -> list of tuples (key, start, end)
  find_words(string, trie)
find_words(string, trie) -> list of tuples (key, start, end)
  match(string, trie)
match(string, trie) -> longest key or None
  match_all(string, trie)
match_all(string, trie) -> list of keys

Variable Summary
str DEFAULT_BOUNDARY_CHARS = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`...

Function Details

find(string, trie)

find(string, trie) -> list of tuples (key, start, end)

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

find_words(string, trie)

find_words(string, trie) -> list of tuples (key, start, end)

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

match(string, trie)

match(string, trie) -> longest key or None

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

match_all(string, trie)

match_all(string, trie) -> list of keys

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

Variable Details

DEFAULT_BOUNDARY_CHARS

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

Generated by Epydoc 2.1 on Sat Jul 16 15:49:02 2005 http://epydoc.sf.net