Websites using the
rwt-search DOM component need to access a ternary-trie of words and the documents where those words are found. This library is used to populate that ternary-trie with the contents of a file retrieved via an AJAX call.
The ternwords library may be installed directly from github or via NPM.
To add the library to a node.js project, use this command:
[user@host]# npm install ternwords
Node.js project usage:
import FileInterface from '/node_modules/ternwords/esm/file-interface.class.js';
import TernWords from '/node_modules/ternwords/esm/tern-words.class.js';
var fileInterface = new FileInterface();
var ternWords = new TernWords();
To add the library to a browser project, use this command:
[user@host]# git clone https://github.com/readwritetools/ternwords.git
Browser project usage:
import TextInterface from '/ternwords/esm/text-interface.class.js';
import TernWords from '/ternwords/esm/tern-words.class.js';
var textInterface = new TextInterface();
var ternWords = new TernWords();
var textBlob = localStorage.getItem('sitewords-data');
var textInterface.readSiteWords(textBlob, this.ternWords);
This library depends on softlib and iolib, which should be installed side-by-side.
|Documentation||Read Write Hub|
The ternwords library is not freeware. After evaluating it and before using it in a public-facing website, eBook, mobile app, or desktop application, you must obtain a license from Read Write Tools as part of the rwt-search DOM component.
Site Search Software License Agreement
Copyright © 2023 Read Write Tools.
- This Software License Agreement ("Agreement") is a legal contract between you and Read Write Tools ("RWT"). The "Materials" subject to this Agreement include the "Site Search" software and associated documentation.
- By using these Materials, you agree to abide by the terms and conditions of this Agreement.
- The Materials are protected by United States copyright law, and international treaties on intellectual property rights. The Materials are licensed, not sold to you, and can only be used in accordance with the terms of this Agreement. RWT is and remains the owner of all titles, rights and interests in the Materials, and RWT reserves all rights not specifically granted under this Agreement.
- Subject to the terms of this Agreement, RWT hereby grants to you a limited, non-exclusive license to use the Materials subject to the following conditions:
- You may not distribute, publish, sub-license, sell, rent, or lease the Materials.
- You may not decompile or reverse engineer any source code included in the software.
- You may not modify or extend any source code included in the software.
- Your license to use the software is limited to the purpose for which it was originally intended, and does not include permission to extract, link to, or use parts on a separate basis.
- An eBook published under a single title and author.
- A mobile app for distribution under a single app name.
- A desktop application published under a single application name.
- A website published under a single domain name. For this purpose, and by way of example, the domain names "alpha.example.com" and "beta.example.com" are considered to be separate websites.
- A load-balanced collection of web servers, used to provide access to a single website under a single domain name.