Method code for $trie.match_begin()

[Turn on line numbering]
arg trie, key;
var n, t;

if (trie[1] && (key == trie[1][1] || trie.length() == 2 && match_begin(trie[1][1], key)))
    return trie[1];
if (!key)
    throw(~ambig, "Trie: ambiguous match.");
if (!(n = key[1] in trie[2]))
    throw(~keynf, "Trie: key not found.");
(> (t = .match_begin(trie[n + 2], key.subrange(2))) <);
t = t.replace(1, key[1] + t[1]);
return t;

["// Miroslav Silovic ", "// Created 09-May-1995 as a part of ColdCore, see: @help Credit"]

the Cold Dark