Semantic MediaWiki and related extensions
|
Public Member Functions | |
addTerm (&$term, $definition) | |
getMinTermLength () | |
getTermList () | |
findNextTerm (&$lexemes, $index, $countLexemes) | |
findNextTermNoSkip (array &$tree, &$lexemes, $index, $countLexemes) | |
Public Attributes | |
const | TREE_VERSION = 2 |
Protected Member Functions | |
& | addElement (array &$path, &$term, &$definition) |
The Lingo class.
Vocabulary: Term - The term as a normal string Definition - Its definition (any object) Element - An element (leaf) in the glossary tree Path - The path in the tree to the leaf representing a term
The glossary is organized as a tree (nested arrays) where the path to the definition of a term is the lexemes of the term followed by -1 as the end marker.
Example: The path to the definition of the term "foo bar baz" would be 'foo'.' '.'bar'.' '.'baz'.'-1'. It could thus be accessed as $mTree['foo'][' ']['bar'][' ']['baz'][-1]
|
protected |
Lingo\Tree::addTerm | ( | & | $term, |
$definition | |||
) |
Lingo\Tree::findNextTerm | ( | & | $lexemes, |
$index, | |||
$countLexemes | |||
) |
$lexemes | ||
int | $index | |
int | $countLexemes |
Lingo\Tree::findNextTermNoSkip | ( | array & | $tree, |
& | $lexemes, | ||
$index, | |||
$countLexemes | |||
) |
array | $tree | |
$lexemes | ||
$index | ||
$countLexemes |
Lingo\Tree::getMinTermLength | ( | ) |
Lingo\Tree::getTermList | ( | ) |