paknevis
Version:
Paknevis.js is a persian text formatter tool.
28 lines (27 loc) • 1.01 kB
TypeScript
/**
* Base class of Paknevis.js
* @class
*/
export declare class Paknevis {
/**
* This function normalise strings to improve detection of banned words.
* @param {string} text your text
* @returns {string}
*/
private static normalise;
/**
* This function checks if text contains any filtered word.good for just checking.
* @param {string} text input text
* @param {string[]} [extraWords] use this to add any extra words in array.
* @returns {boolean}
*/
static hasBadWords(text: string, extraWords?: string[]): boolean;
/**
* This function censores banned words.note that it could not find words in some scenarios.
* @param {string} text input text
* @param {string} [censorChar] good for masking banned word. defualt is empty.
* @param {string[]} [extraWords] use this to add any extra words in array.
* @returns {string}
*/
static censor(text: string, censorChar?: string, extraWords?: string[]): string;
}