Files

46 lines
1.5 MiB
JavaScript
Raw Permalink Normal View History

2026-05-13 17:18:50 +08:00
window.pdocSearch = (function(){
/** elasticlunr - http://weixsong.github.io * Copyright (C) 2017 Oliver Nightingale * Copyright (C) 2017 Wei Song * MIT Licensed */!function(){function e(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.9.5",lunr=t,t.utils={},t.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),t.utils.toString=function(e){return void 0===e||null===e?"":e.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},t.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0==this.events[e].length&&delete this.events[e])}},t.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)},this)}},t.EventEmitter.prototype.hasHandler=function(e){return e in this.events},t.tokenizer=function(e){if(!arguments.length||null===e||void 0===e)return[];if(Array.isArray(e)){var n=e.filter(function(e){return null===e||void 0===e?!1:!0});n=n.map(function(e){return t.utils.toString(e).toLowerCase()});var i=[];return n.forEach(function(e){var n=e.split(t.tokenizer.seperator);i=i.concat(n)},this),i}return e.toString().trim().toLowerCase().split(t.tokenizer.seperator)},t.tokenizer.defaultSeperator=/[\s\-]+/,t.tokenizer.seperator=t.tokenizer.defaultSeperator,t.tokenizer.setSeperator=function(e){null!==e&&void 0!==e&&"object"==typeof e&&(t.tokenizer.seperator=e)},t.tokenizer.resetSeperator=function(){t.tokenizer.seperator=t.tokenizer.defaultSeperator},t.tokenizer.getSeperator=function(){return t.tokenizer.seperator},t.Pipeline=function(){this._queue=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in t.Pipeline.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[n]=e},t.Pipeline.getRegisteredFunction=function(e){return e in t.Pipeline.registeredFunctions!=!0?null:t.Pipeline.registeredFunctions[e]},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.getRegisteredFunction(e);if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i+1,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i,0,n)},t.Pipeline.prototype.remove=function(e){var t=this._queue.indexOf(e);-1!==t&&this._queue.splice(t,1)},t.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._queue.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t
/** pdoc search index */const docs = [{"fullname": "UniTAP.tsi_lib", "modulename": "UniTAP.tsi_lib", "kind": "module", "doc": "<p></p>\n"}, {"fullname": "UniTAP.tsi_lib.DeviceMask", "modulename": "UniTAP.tsi_lib", "qualname": "DeviceMask", "kind": "class", "doc": "<p>Enum where members are also (and must be) ints</p>\n", "bases": "enum.IntEnum"}, {"fullname": "UniTAP.tsi_lib.DeviceMask.Sink", "modulename": "UniTAP.tsi_lib", "qualname": "DeviceMask.Sink", "kind": "variable", "doc": "<p></p>\n", "default_value": "&lt;DeviceMask.Sink: 0&gt;"}, {"fullname": "UniTAP.tsi_lib.DeviceMask.Source", "modulename": "UniTAP.tsi_lib", "qualname": "DeviceMask.Source", "kind": "variable", "doc": "<p></p>\n", "default_value": "&lt;DeviceMask.Source: 1&gt;"}, {"fullname": "UniTAP.tsi_lib.DeviceMask.All", "modulename": "UniTAP.tsi_lib", "qualname": "DeviceMask.All", "kind": "variable", "doc": "<p></p>\n", "default_value": "&lt;DeviceMask.All: 2&gt;"}, {"fullname": "UniTAP.tsi_lib.DeviceMask.Nothing", "modulename": "UniTAP.tsi_lib", "qualname": "DeviceMask.Nothing", "kind": "variable", "doc": "<p></p>\n", "default_value": "&lt;DeviceMask.Nothing: 3&gt;"}, {"fullname": "UniTAP.tsi_lib.DeviceAlreadyInUse", "modulename": "UniTAP.tsi_lib", "qualname": "DeviceAlreadyInUse", "kind": "class", "doc": "<p>Redefinition of base exception.\nDefine error of 'device already in use'.</p>\n", "bases": "builtins.Exception"}, {"fullname": "UniTAP.tsi_lib.FailedToOpenDevice", "modulename": "UniTAP.tsi_lib", "qualname": "FailedToOpenDevice", "kind": "class", "doc": "<p>Redefinition of base exception.\nDefine error of 'device already in use'.</p>\n", "bases": "builtins.Exception"}, {"fullname": "UniTAP.tsi_lib.DeviceNotFound", "modulename": "UniTAP.tsi_lib", "qualname": "DeviceNotFound", "kind": "class", "doc": "<p>Redefinition of base exception.\nDefine error of 'device not found'.</p>\n", "bases": "builtins.Exception"}, {"fullname": "UniTAP.tsi_lib.DeviceNotSupported", "modulename": "UniTAP.tsi_lib", "qualname": "DeviceNotSupported", "kind": "class", "doc": "<p>Redefinition of base exception.\nDefine error of 'device not supported'.</p>\n", "bases": "builtins.Exception"}, {"fullname": "UniTAP.tsi_lib.TsiLib", "modulename": "UniTAP.tsi_lib", "qualname": "TsiLib", "kind": "class", "doc": "<p>Class <code>TsiLib</code> allows working with TSI Devices.</p>\n\n<ul>\n<li>Open selected device <code>open</code>.</li>\n</ul>\n"}, {"fullname": "UniTAP.tsi_lib.TsiLib.cleanup", "modulename": "UniTAP.tsi_lib", "qualname": "TsiLib.cleanup", "kind": "function", "doc": "<p>Clear list of devices and call function <code>TSI_Clean</code> for cleaning TSI library.</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "UniTAP.tsi_lib.TsiLib.open", "modulename": "UniTAP.tsi_lib", "qualname": "TsiLib.open", "kind": "function", "doc": "<p>Open selected TSI device.</p>\n\n<h6 id=\"arguments\">Arguments:</h6>\n\n<ul>\n<li>info (str|int) - serial number of device or device index.</li>\n</ul>\n\n<h6 id=\"returns\">Returns:</h6>\n\n<blockquote>\n <p>object of <code>TSIDevice</code> type</p>\n</blockquote>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">info</span><span class=\"p\">:</span> <span class=\"n\">Union</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"nb\">int</span><span class=\"p\">]</span></span><span class=\"return-annotation\">) -> <span class=\"n\">UniTAP</span><span class=\"o\">.</span><span class=\"n\">dev</span><span class=\"o\">.</span><span class=\"n\">device</span><span class=\"o\">.</span><span class=\"n\">TSIDevice</span>:</span></span>", "funcdef": "def"}, {"fullname": "UniTAP.tsi_lib.TsiLib.close", "modulename": "UniTAP.tsi_lib", "qualname": "TsiLib.close", "kind": "function", "doc": "<p>Close selected device <code>TSIDevice</code> (r
// mirrored in build-search-index.js (part 1)
// Also split on html tags. this is a cheap heuristic, but good enough.
elasticlunr.tokenizer.setSeperator(/[\s\-.;&_'"=,()]+|<[^>]*>/);
let searchIndex;
if (docs._isPrebuiltIndex) {
console.info("using precompiled search index");
searchIndex = elasticlunr.Index.load(docs);
} else {
console.time("building search index");
// mirrored in build-search-index.js (part 2)
searchIndex = elasticlunr(function () {
this.pipeline.remove(elasticlunr.stemmer);
this.pipeline.remove(elasticlunr.stopWordFilter);
this.addField("qualname");
this.addField("fullname");
this.addField("annotation");
this.addField("default_value");
this.addField("signature");
this.addField("bases");
this.addField("doc");
this.setRef("fullname");
});
for (let doc of docs) {
searchIndex.addDoc(doc);
}
console.timeEnd("building search index");
}
return (term) => searchIndex.search(term, {
fields: {
qualname: {boost: 4},
fullname: {boost: 2},
annotation: {boost: 2},
default_value: {boost: 2},
signature: {boost: 2},
bases: {boost: 2},
doc: {boost: 1},
},
expand: true
});
})();