Lucene.Net.Analysis.Synonym.SynonymMap.Builder.Join C# (CSharp) Метод

Join() публичный статический метод

Sugar: just joins the provided terms with {@link SynonymMap#WORD_SEPARATOR}. reuse and its chars must not be null.
public static Join ( string words, CharsRef reuse ) : CharsRef
words string
reuse CharsRef
Результат CharsRef
            public static CharsRef Join(string[] words, CharsRef reuse)
            {
                int upto = 0;
                char[] buffer = reuse.Chars;
                foreach (string word in words)
                {
                    int wordLen = word.Length;
                    int needed = (0 == upto ? wordLen : 1 + upto + wordLen); // Add 1 for WORD_SEPARATOR
                    if (needed > buffer.Length)
                    {
                        reuse.Grow(needed);
                        buffer = reuse.Chars;
                    }
                    if (upto > 0)
                    {
                        buffer[upto++] = SynonymMap.WORD_SEPARATOR;
                    }

                    word.CopyTo(0, buffer, upto, wordLen - 0);
                    upto += wordLen;
                }
                reuse.Length = upto;
                return reuse;
            }