コード例 #1
0
        private static IList <ITextExtractor> GetTextExtractors(TextExtractorSetting textExtractorSetting)
        {
            if (textExtractorSetting.CustomTextExtractors != null && textExtractorSetting.CustomTextExtractors.Any())
            {
                return(textExtractorSetting.CustomTextExtractors);
            }

            return(new List <ITextExtractor>()
            {
                new JavaTextExtractor(),
                new CPlusPlusTextExtractor(),
                new CSharpTextExtractor(),
                new SmallTalkTextExtractor()
            });
        }
コード例 #2
0
        /// <summary>
        /// Gets IndexerConfiguration from settings
        /// </summary>
        /// <param name="splitterSetting">Splitter Setting. Cannot be null.</param>
        /// <param name="dictionarySetting">Cannot be null.</param>
        /// <param name="textExtractorSetting">Cannot be null.</param>
        /// <param name="textCorrectorSetting">Cannot be null.</param>
        /// <param name="stemmerSetting">Cannot be null.</param>
        /// <param name="filesToScan">Cannot be null.</param>
        /// <param name="notificationHandler">Notification updater</param>
        /// <returns></returns>
        public static IndexerConfiguration GetIndexerConfiguration(SplitterSetting splitterSetting, DictionarySetting dictionarySetting,
                                                                   TextExtractorSetting textExtractorSetting, TextCorrectorSetting textCorrectorSetting, StemmerSetting stemmerSetting,
                                                                   List <IndexerFile> filesToScan, INotificationHandler notificationHandler = null)
        {
            if (splitterSetting == null)
            {
                throw new ArgumentNullException(nameof(splitterSetting));
            }

            if (dictionarySetting == null)
            {
                throw new ArgumentNullException(nameof(dictionarySetting));
            }

            if (textExtractorSetting == null)
            {
                throw new ArgumentNullException(nameof(textExtractorSetting));
            }

            if (textCorrectorSetting == null)
            {
                throw new ArgumentNullException(nameof(textCorrectorSetting));
            }

            if (stemmerSetting == null)
            {
                throw new ArgumentNullException(nameof(stemmerSetting));
            }

            if (filesToScan == null)
            {
                throw new ArgumentNullException(nameof(filesToScan));
            }

            IndexerConfiguration indexerConfiguration = new IndexerConfiguration(GetSplitter(splitterSetting), GetSplitType(textExtractorSetting),
                                                                                 GetDictionary(dictionarySetting), GetTextExtractors(textExtractorSetting), GetTextCorrector(textCorrectorSetting),
                                                                                 GetStemmer(stemmerSetting), filesToScan, notificationHandler);

            return(indexerConfiguration);
        }
コード例 #3
0
 private static ExtractType GetSplitType(TextExtractorSetting textExtractorSetting)
 {
     return(textExtractorSetting.ExtractType == 0 ? ExtractType.IdentifiersAndStringLiterals | ExtractType.Comments : textExtractorSetting.ExtractType);
 }