SpellChecker.Net.Search.Spell.SpellChecker.FormGrams C# (CSharp) 메소드

FormGrams() 개인적인 정적인 메소드

Form all ngrams for a given word.
private static FormGrams ( System text, int ng ) : System.String[]
text System the word to parse ///
ng int the ngram length e.g. 3 ///
리턴 System.String[]
        private static System.String[] FormGrams(System.String text, int ng)
        {
            int len = text.Length;
            System.String[] res = new System.String[len - ng + 1];
            for (int i = 0; i < len - ng + 1; i++)
            {
                res[i] = text.Substring(i, (i + ng) - (i));
            }
            return res;
        }