Lucene.Net.Index.BaseTermVectorsFormatTestCase.RandomDocumentFactory.RandomDocumentFactory C# (CSharp) Method

RandomDocumentFactory() protected method

protected RandomDocumentFactory ( BaseTermVectorsFormatTestCase outerInstance, int distinctFieldNames, int disctinctTerms ) : Lucene.Net.Analysis.Tokenattributes
outerInstance BaseTermVectorsFormatTestCase
distinctFieldNames int
disctinctTerms int
return Lucene.Net.Analysis.Tokenattributes
            protected internal RandomDocumentFactory(BaseTermVectorsFormatTestCase outerInstance, int distinctFieldNames, int disctinctTerms)
            {
                this.OuterInstance = outerInstance;
                HashSet<string> fieldNames = new HashSet<string>();
                while (fieldNames.Count < distinctFieldNames)
                {
                    fieldNames.Add(TestUtil.RandomSimpleString(Random()));
                    fieldNames.Remove("id");
                }
                this.FieldNames = fieldNames.ToArray(/*new string[0]*/);
                Terms = new string[disctinctTerms];
                TermBytes = new BytesRef[disctinctTerms];
                for (int i = 0; i < disctinctTerms; ++i)
                {
                    Terms[i] = TestUtil.RandomRealisticUnicodeString(Random());
                    TermBytes[i] = new BytesRef(Terms[i]);
                }
            }
BaseTermVectorsFormatTestCase.RandomDocumentFactory