示例#1
0
        public WebSearch(ISearchDomain searchDomain, IKeywordExtractor keywordExtractor)
        {
            SearchDomain     = searchDomain;
            KeywordExtractor = keywordExtractor;

            SearchSettings.MaxLinks      = _maxLinks;
            SearchSettings.MaxParagraphs = _maxParagraphs;
        }
示例#2
0
        /// <summary>
        /// In the constructor, we will attempt to get the language specific extractor.
        /// If we can't find one then we'll revert to the default language
        /// </summary>
        /// <param name="lngIsoCode"></param>
        internal Keyword_BSO_Extract(string lngIsoCode)
        {
            keyword = new PxStat.Keyword(lngIsoCode);

            string extractorClassName = Utility.GetCustomConfig("APP_INTERNATIONALISATION_EXTRACTOR_CLASS_NAME") + lngIsoCode;


            Type extractorType = Type.GetType(extractorClassName);

            if (extractorType != null)
            {
                this.extractor = (IKeywordExtractor)Assembly.GetAssembly(extractorType).CreateInstance(extractorType.FullName);
            }
            else
            {
                extractorClassName = Utility.GetCustomConfig("APP_INTERNATIONALISATION_EXTRACTOR_CLASS_NAME") + Configuration_BSO.GetCustomConfig(ConfigType.global, "language.iso.code");
                extractorType      = Type.GetType(extractorClassName);
                this.extractor     = (IKeywordExtractor)Assembly.GetAssembly(extractorType).CreateInstance(extractorClassName);
            }
        }
        internal void Create(ADO Ado, Product_DTO productDto, int productID)
        {
            //There is no direct means of finding out which langauge the product name uses,
            // so we take a default language from the settings
            string languageCode = Utility.GetCustomConfig("APP_KEYWORD_DEFAULT_LANGUAGE_ISO_CODE");

            //Create the table that will be bulk inserted
            DataTable dt = new DataTable();

            dt.Columns.Add("KPR_VALUE", typeof(string));
            dt.Columns.Add("KPR_PRC_ID", typeof(int));
            dt.Columns.Add("KPR_MANDATORY_FLAG", typeof(bool));

            Keyword_Product_ADO keywordProductAdo = new Keyword_Product_ADO(Ado);


            //Get a Keyword Extractor - the particular version returned will depend on the language
            IKeywordExtractor ext = Keyword_BSO_Extract.GetExtractor(languageCode);

            AddToTable(ref dt, ext.ExtractSplitSingular(productDto.PrcValue), productID);

            keywordProductAdo.Create(dt);
        }
 public BlogFileRepository(IOptionsMonitor <BlogFileRepositoryOptions> optionsMonitor, IKeywordExtractor keywordExtractor) : base(keywordExtractor)
 {
     blogFolder = optionsMonitor.CurrentValue.Folder;
 }
 public LandingMemoryRepository(IKeywordExtractor keywordExtractor)
 {
     features              = new Dictionary <string, LandingFeature>();
     competitors           = new Dictionary <string, LandingCompetitor>();
     this.keywordExtractor = keywordExtractor;
 }
示例#6
0
 public TextRankProvider(IKeywordExtractor extractor)
 {
     KeywordExtractor = extractor;
 }
示例#7
0
 public WebSearch(ISearchDomain searchDomain, IKeywordExtractor keywordExtractor, SearchSettingsType settings) : this(searchDomain, keywordExtractor)
 {
     SearchSettings = settings;
 }
 public BlogMemoryRepository(IKeywordExtractor keywordExtractor)
 {
     blogPosts             = new Dictionary <string, BlogPost>();
     this.keywordExtractor = keywordExtractor;
 }
        /// <summary>
        /// Simple repository based on local files.
        /// </summary>
        public LandingFileRepository(IOptionsMonitor <LandingFileRepositoryOptions> optionsMonitor, IKeywordExtractor keywordExtractor) : base(keywordExtractor)
        {
            var features = JsonSerializer.Deserialize <List <Models.LandingFeature> >(File.ReadAllText(optionsMonitor.CurrentValue.FeaturesFile));

            foreach (var feature in features)
            {
                Add(feature);
            }


            var competitors = JsonSerializer.Deserialize <List <Models.LandingCompetitor> >(File.ReadAllText(optionsMonitor.CurrentValue.CompetitorsFile));

            foreach (var competitor in competitors)
            {
                Add(competitor);
            }
        }
示例#10
0
 public Synonymizer(IKeywordExtractor extractor, DictionaryApi api) : this(extractor)
 {
     Api = api;
 }
示例#11
0
 public Synonymizer(IKeywordExtractor extractor)
 {
     KeywordExtractor = extractor;
     Api = new DictionaryApi();
 }
 public TextRankByFrequency(IKeywordExtractor extractor) : base(extractor)
 {
 }