예제 #1
0
        // cSpell main process: input str, output Str
        /// <summary>
        /// cSpell correction process, output to a string. Use funcmode and rankmode
        /// specified in the configuration file.
        /// </summary>
        /// <param name="inText">   input text to be corrected </param>
        /// <returns>  corrected text </returns>
        public virtual string ProcessToStr(string inText)
        {
            // use modes from configuration
            string outStr = CorrectionApi.ProcessToStr(inText, this);

            return(outStr);
        }
예제 #2
0
        public string Correct(string input)
        {
            _logger.LogTrace($"Correction called");
            string outStr = CorrectionApi.ProcessToStr(input, this);

            return(outStr);
        }
예제 #3
0
        /// <summary>
        /// cSpell correction process, output to an ArrayList of TokenObj by using
        /// funcMode and rankMode from configuratin files, with debug print option.
        /// </summary>
        /// <param name="inText">   input text to be corrected </param>
        /// <param name="debugFlag"> boolean flag for debug print </param>
        /// <returns>  an ArrayList of TokenObj </returns>
        public virtual List <TokenObj> ProcessToTokenObj(string inText, bool debugFlag)
        {
            DebugPrint.Println("====== SpellApi.Process( ), funcMode: " + funcMode_ + ", rankMode: " + rankMode_ + " ======", debugFlag);
            // non-dictionary and dictionary base correction
            List <TokenObj> inTokenList  = TextObj.TextToTokenList(inText);
            List <TokenObj> outTokenList = CorrectionApi.ProcessByTokenObj(inTokenList, this, debugFlag);

            return(outTokenList);
        }
예제 #4
0
        /// <summary>
        /// cSpell correction process, output to a string by
        /// specifying funcMode and rankMode.
        /// </summary>
        /// <param name="inText">   input text to be corrected </param>
        /// <param name="funcMode"> funcMode for correction: NW/RW-Merge/Split/1To1 </param>
        /// <param name="rankMode"> rankMode for select correction from the candidate for NW
        ///                     Split/1To1 </param>
        /// <returns>  corrected text </returns>
        public virtual string ProcessToStr(string inText, int funcMode, int rankMode)
        {
            // update modes
            this.funcMode_ = funcMode;
            this.rankMode_ = rankMode;
            string outStr = CorrectionApi.ProcessToStr(inText, this);

            return(outStr);
        }
예제 #5
0
 public (string, List <TokenObj>) CorrectExt(string input)
 {
     _logger.LogTrace($"Correction called");
     return(CorrectionApi.ProcessToStrExt(input, this, false));
 }