library/spellingCheck.js
function spellingFix(content, fontType){
  if (!content) {
    if (!globalOptions.isSilentMode()) console.warn('Content must be specified on knayi.spellingFix.');
    return '';
  }

	if (content === '' || !mmCharacterRange.test(content))
		return content;

	if (!fontType)
		fontType = fontDetect(content);

	content = content.trim().replace(/\u200B/g, '');

	switch (fontType) {
		case 'zawgyi':
			for (var i = 0; i < library.spellingFix.zawgyi.length; i++) {
				var rule = library.spellingFix.zawgyi[i];
				content = content.replace(rule[0], rule[1]);
			}
			return content;
		case 'unicode':
		default:
			for (var i = 0; i < library.spellingFix.unicode.length; i++) {
				var rule = library.spellingFix.unicode[i];
				content = content.replace(rule[0], rule[1]);
			}
			return content;
	}
}
function spellingFix(content, fontType){
  if (!content) {
    if (!globalOptions.isSilentMode()) console.warn('Content must be specified on knayi.spellingFix.');
    return '';
  }

	if (content === '' || !mmCharacterRange.test(content))
		return content;

	if (!fontType)
		fontType = fontDetect(content);

	content = content.trim().replace(/\u200B/g, '');

	switch (fontType) {
		case 'zawgyi':
			for (var i = 0; i < library.spellingFix.zawgyi.length; i++) {
				var rule = library.spellingFix.zawgyi[i];
				content = content.replace(rule[0], rule[1]);
			}
			return content;
		case 'unicode':
		default:
			for (var i = 0; i < library.spellingFix.unicode.length; i++) {
				var rule = library.spellingFix.unicode[i];
				content = content.replace(rule[0], rule[1]);
			}
			return content;
	}
}
function spellingFix ( content , fontType ) { if ( ! content ) { if ( ! globalOptions . isSilentMode ( ) ) console . warn ( 'Content must be specified on knayi.spellingFix.' ) ; return '' ; } if ( content === '' || ! mmCharacterRange . test ( content ) ) return content ; if ( ! fontType ) fontType = fontDetect ( content ) ; content = content . trim ( ) . replace ( / \u200B / g , '' ) ; switch ( fontType ) { case 'zawgyi' : for ( var i = 0 ; i < library . spellingFix . zawgyi . length ; i ++ ) { var rule = library . spellingFix . zawgyi [ i ] ; content = content . replace ( rule [ 0 ] , rule [ 1 ] ) ; } return content ; case 'unicode' : default : for ( var i = 0 ; i < library . spellingFix . unicode . length ; i ++ ) { var rule = library . spellingFix . unicode [ i ] ; content = content . replace ( rule [ 0 ] , rule [ 1 ] ) ; } return content ; } }
Spelling Check agent
@param content Text to process
@param fontType Type of font of content
@return edited text
Spelling Check agent