dojox/editor/plugins/_SpellCheckParser.js

  • Provides:

    • dojox.editor.plugins._SpellCheckParser
  • dojox.editor.plugins._SpellCheckParser

    • type
      Function
    • summary
  • dojox.editor.plugins._SpellCheckParser.lang

    • summary
  • dojox.editor.plugins._SpellCheckParser.parseIntoWords

    • type
      Function
    • parameters:
      • text: (typeof String)
        Plain text without html tags
    • source: [view]
        function isCharExt(c){
         var ch = c.charCodeAt(0);
         return 48 <= ch && ch <= 57 || 65 <= ch && ch <= 90 || 97 <= ch && ch <= 122;
        }
        var words = this.words = [],
         indices = this.indices = [],
         index = 0,
         length = text && text.length,
         start = 0;

        
        while(index < length){
         var ch;
         // Skip the white charactor and need to treat HTML entity respectively
         while(index < length && !isCharExt(ch = text.charAt(index)) && ch != "&"){ index++; }
         if(ch == "&"){ // An HTML entity, skip it
          while(++index < length && (ch = text.charAt(index)) != ";" && isCharExt(ch)){}
         }else{ // A word
          start = index;
          while(++index < length && isCharExt(text.charAt(index))){}
          if(start < length){
           words.push(text.substring(start, index));
           indices.push(start);
          }
         }
        }

        
        return words;
    • summary
      Parse the text into words
    • tags:
    • return_summary
      Array holding all the words
  • dojox.editor.plugins._SpellCheckParser.getIndices

    • type
      Function
    • source: [view]
        return this.indices;
    • summary
      Get the indices of the words. They are in one-to-one correspondence
    • tags:
    • return_summary
      Index array
  • dojox.editor.plugins._SpellCheckParser.words

    • summary
  • dojox.editor.plugins._SpellCheckParser.indices

    • summary
  • sp.parser

    • summary
  • dojox.editor.plugins

    • type
      Object
    • summary
  • dojox.editor

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary