CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
encode-info.d.ts33 linesDownload Raw Back to util
1/**2 * Check whether to encode (as a character reference) the characters3 * surrounding an attention run.4 *5 * Which characters are around an attention run influence whether it works or6 * not.7 *8 * See <https://github.com/orgs/syntax-tree/discussions/60> for more info.9 * See this markdown in a particular renderer to see what works:10 *11 * ```markdown12 * |                         | A (letter inside) | B (punctuation inside) | C (whitespace inside) | D (nothing inside) |13 * | ----------------------- | ----------------- | ---------------------- | --------------------- | ------------------ |14 * | 1 (letter outside)      | x*y*z             | x*.*z                  | x* *z                 | x**z               |15 * | 2 (punctuation outside) | .*y*.             | .*.*.                  | .* *.                 | .**.               |16 * | 3 (whitespace outside)  | x *y* z           | x *.* z                | x * * z               | x ** z             |17 * | 4 (nothing outside)     | *x*               | *.*                    | * *                   | **                 |18 * ```19 *20 * @param {number} outside21 *   Code point on the outer side of the run.22 * @param {number} inside23 *   Code point on the inner side of the run.24 * @param {'*' | '_'} marker25 *   Marker of the run.26 *   Underscores are handled more strictly (they form less often) than27 *   asterisks.28 * @returns {EncodeSides}29 *   Whether to encode characters.30 */31export function encodeInfo(outside: number, inside: number, marker: "*" | "_"): EncodeSides;32import type { EncodeSides } from '../types.js';33//# sourceMappingURL=encode-info.d.ts.map