private List <Person> ParseRawHtmlFilesFromDirectory()
        {
            List <Person> people   = new List <Person>();
            var           document = new HtmlDocument();
            int           idCount  = 0;

            foreach (var file in Directory.EnumerateFiles(@"C:\Users\Niall\Documents\Visual Studio 2015\Projects\LinkedInSearchUi\LinkedIn Dataset\SmallLinkedInDataSet", "*.html"))
            {
                try
                {
                    document.Load(file);
                    var person = _parser.GeneratePersonFromHtmlDocument(document);
                    person.Id = idCount++;
                    people.Add(person);
                    if (people.Count % 1000 == 0)
                    {
                        Console.WriteLine(people.Count);
                    }
                }
                catch (Exception e) { }
            }
            _personCustomXmlService.WriteToFile(people, @"C:\Users\Niall\Documents\Visual Studio 2015\Projects\LinkedInSearchUi\LinkedIn Dataset\XML\data.xml");
            _luceneService = new LuceneService(people);
            return(people);
        }
        private List <Person> ParseTrainingPeopleTopJobFromXml()
        {
            var people = _personCustomXmlService.ReadFromFile(@"C:\Users\Niall\5th Year\Thesis\XML\TrainingSetMostPopularJob.xml");

            _luceneService = new LuceneService(people);
            return(people);
        }
        private List <Person> ParseTrainingPeopleFromXml()
        {
            var people = _personCustomXmlService.ReadFromFile(@"C:\Users\Niall\5th Year\Thesis\XML\training_set_new.xml");

            _luceneService = new LuceneService(people);
            return(people);
        }
        public ProductController(SqlServerContext context, ILuceneService luceneService)
        {
            _context       = context;
            _luceneService = luceneService;

            //var products = _context.Product.ToList();
            //_luceneService.AddSpecificationToIndex(products);
        }
Exemple #5
0
 public LuceneController(ISettingService settingService,
                         ILuceneService luceneService,
                         IStoreContext storeContext)
 {
     _settingService = settingService;
     _luceneService  = luceneService;
     _storeContext   = storeContext;
 }
 public SearchService(
     IUserRepository userRepository,
     IUserMessageRepository userMessageRepository,
     ILuceneService luceneService)
 {
     _userRepository        = userRepository;
     _userMessageRepository = userMessageRepository;
     _luceneService         = luceneService;
 }
Exemple #7
0
 private void InitialiseServices()
 {
     _categoryService     = DependencyResolver.Current.GetService <ICategoryService>();
     _membershipService   = DependencyResolver.Current.GetService <IMembershipService>();
     _roleService         = DependencyResolver.Current.GetService <IRoleService>();
     _localizationService = DependencyResolver.Current.GetService <ILocalizationService>();
     _settingsService     = DependencyResolver.Current.GetService <ISettingsService>();
     _UnitOfWorkManager   = DependencyResolver.Current.GetService <IUnitOfWorkManager>();
     _permissionService   = DependencyResolver.Current.GetService <IPermissionService>();
     _luceneService       = DependencyResolver.Current.GetService <ILuceneService>();
 }
Exemple #8
0
        public SearchController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager,
                                IMembershipService membershipService, ILocalizationService localizationService,
                                IRoleService roleService, ISettingsService settingsService,
                                IPostService postService, ITopicService topicService, ILuceneService luceneService)
            : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
        {
            _postService   = postService;
            _topicsService = topicService;
            _luceneService = luceneService;

            LoggedOnUser = UserIsAuthenticated ? MembershipService.GetUser(Username) : null;
            UsersRole    = LoggedOnUser == null?RoleService.GetRole(AppConstants.GuestRoleName) : LoggedOnUser.Roles.FirstOrDefault();
        }
 public ModerateController(ILoggingService loggingService,
     IUnitOfWorkManager unitOfWorkManager,
     IMembershipService membershipService,
     ILocalizationService localizationService,
     IRoleService roleService,
     ISettingsService settingsService, IPostService postService, ITopicService topicService, ILuceneService luceneService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, settingsService)
 {
     _topicService = topicService;
     _luceneService = luceneService;
     _postService = postService;
     _roleService = roleService;
 }
Exemple #10
0
 public ModerateController(ILoggingService loggingService,
                           IUnitOfWorkManager unitOfWorkManager,
                           IMembershipService membershipService,
                           ILocalizationService localizationService,
                           IRoleService roleService,
                           ISettingsService settingsService, IPostService postService, ITopicService topicService, ILuceneService luceneService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, settingsService)
 {
     _topicService  = topicService;
     _luceneService = luceneService;
     _postService   = postService;
     _roleService   = roleService;
 }
        public SearchController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, 
            IMembershipService membershipService, ILocalizationService localizationService,
            IRoleService roleService, ISettingsService settingsService,
            IPostService postService, ITopicService topicService, ILuceneService luceneService)
            : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
        {
            _postService = postService;
            _topicsService = topicService;
            _luceneService = luceneService;

            LoggedOnUser = UserIsAuthenticated ? MembershipService.GetUser(Username) : null;
            UsersRole = LoggedOnUser == null ? RoleService.GetRole(AppConstants.GuestRoleName) : LoggedOnUser.Roles.FirstOrDefault();
        }
Exemple #12
0
    public void SearchLoi()
    {
        if (!isFound)
        {
            //sql
            string key = Request.QueryString["TenBH"].ToString();
            string sql = "";
            if (char.IsUpper(key, 0))
            {
                sql = "select * from BAIHAT where LoiBaiHat like N'%" + key + " %'";
            }
            else
            {
                sql = "select * from BAIHAT where LoiBaiHat like N'% " + key + " %'";
            }

            DataTable  all = x.GetDaTa(sql);
            DataColumn col = new DataColumn();
            col.DataType   = Type.GetType("System.String");
            col.ColumnName = "TimKiem";
            all.Columns.Add(col);

            DataTable lbh = new DataView(all).ToTable(false, "LoiBaiHat");

            for (int i = 0; i < all.Rows.Count; i++)
            {
                ls       = new LuceneService();
                readfile = new DataFileReader();
                DataRow rlbh = lbh.Rows[i];
                DataFileRows = readfile.ReadAllRows(rlbh);
                ls.BuildIndex(DataFileRows);
                //lucene search
                var results = ls.Search(Request.QueryString["TenBH"].ToString().ToLower());
                ls.CloseWriter();
                var result = results.FirstOrDefault();
                //create tim kiem
                if (result == null)
                {
                    all.Rows[i]["TimKiem"] = "Không tìm thấy lời bài hát yêu cầu!";
                }
                else
                {
                    all.Rows[i]["TimKiem"] = result.LineText;
                }
            }

            dlSearch.DataSource = all;
            dlSearch.DataBind();
        }
    }
Exemple #13
0
 public LuceneCatalogController(LuceneSettings luceneSettings, CatalogSettings catalogSettings,
                                IProductService productService,
                                IStoreContext storeContext,
                                IWorkContext workContext,
                                IProductModelFactory productModelFactory,
                                MediaSettings mediaSettings, ILuceneService luceneService)
 {
     _luceneSettings      = luceneSettings;
     _catalogSettings     = catalogSettings;
     _productService      = productService;
     _storeContext        = storeContext;
     _workContext         = workContext;
     _productModelFactory = productModelFactory;
     _mediaSettings       = mediaSettings;
     _luceneService       = luceneService;
 }
Exemple #14
0
        public TopicController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, IRoleService roleService, ITopicService topicService, IPostService postService,
                               ICategoryService categoryService, ILocalizationService localizationService, ISettingsService settingsService, ITopicTagService topicTagService, IMembershipUserPointsService membershipUserPointsService,
                               ICategoryNotificationService categoryNotificationService, IEmailService emailService, ITopicNotificationService topicNotificationService, ILuceneService luceneService, IPollService pollService,
                               IPollAnswerService pollAnswerService, IBannedWordService bannedWordService)
            : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
        {
            _topicService                = topicService;
            _postService                 = postService;
            _categoryService             = categoryService;
            _topicTagService             = topicTagService;
            _membershipUserPointsService = membershipUserPointsService;
            _categoryNotificationService = categoryNotificationService;
            _emailService                = emailService;
            _topicNotificationService    = topicNotificationService;
            _luceneService               = luceneService;
            _pollService                 = pollService;
            _pollAnswerService           = pollAnswerService;
            _bannedWordService           = bannedWordService;

            LoggedOnUser = UserIsAuthenticated ? MembershipService.GetUser(Username) : null;
            UsersRole    = LoggedOnUser == null?RoleService.GetRole(AppConstants.GuestRoleName) : LoggedOnUser.Roles.FirstOrDefault();
        }
Exemple #15
0
        public PostController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, 
            ILocalizationService localizationService, IRoleService roleService, ITopicService topicService, IPostService postService, 
            ISettingsService settingsService, ICategoryService categoryService, ITopicTagService topicTagService, 
            ITopicNotificationService topicNotificationService, IEmailService emailService, IReportService reportService, ILuceneService luceneService, IPollAnswerService pollAnswerService, 
            IPollService pollService, IBannedWordService bannedWordService)
            : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
        {
            _topicService = topicService;
            _postService = postService;
            _categoryService = categoryService;
            _topicTagService = topicTagService;
            _topicNotificationService = topicNotificationService;
            _emailService = emailService;
            _reportService = reportService;
            _luceneService = luceneService;
            _pollAnswerService = pollAnswerService;
            _pollService = pollService;
            _bannedWordService = bannedWordService;

            LoggedOnUser = UserIsAuthenticated ? MembershipService.GetUser(Username) : null;
            UsersRole = LoggedOnUser == null ? RoleService.GetRole(AppConstants.GuestRoleName) : LoggedOnUser.Roles.FirstOrDefault();
        }
        public void UpdatePerformanceStats(int randomForestSize, int skillSetSize, string jobName)
        {
            _randomForestSize = randomForestSize;
            _skillSetSize     = skillSetSize;

            if (jobName != _jobName)
            {
                var trainingAndTestingSets = _trainingAndTestingService.CreateTrainingAndTestingSetBasedJobInput(jobName, _jobService.ParseJobStatsFromXml());
                _trainingPeople = trainingAndTestingSets[0];
                _testingPeople  = trainingAndTestingSets[1];
                _jobName        = jobName;
                _luceneService  = new LuceneService(_testingPeople);
            }

            //Train Machine Learning Models with training data
            _randomForestService.Train(_trainingPeople, randomForestSize, skillSetSize);
            _supportVectorMachineService.Train(_trainingPeople, skillSetSize);
            _kMeansService.Train(_trainingPeople, skillSetSize);

            //Test Machine Learning Models with testing data
            _randomForestService.Test(_testingPeople, skillSetSize);
            _supportVectorMachineService.Test(_testingPeople, skillSetSize);
            _kMeansService.Test(_testingPeople, skillSetSize);
        }
 public ScamAlgorithm(IVectorTokenizer vectorTokenizer, ILuceneService luceneService, ScamConfig scamConfig)
 {
     this.vectorTokenizer = vectorTokenizer;
     this.luceneService   = luceneService;
     this.scamConfig      = scamConfig;
 }
 private void InitialiseServices()
 {
     _categoryService = DependencyResolver.Current.GetService<ICategoryService>();
     _membershipService = DependencyResolver.Current.GetService<IMembershipService>();
     _roleService = DependencyResolver.Current.GetService<IRoleService>();
     _localizationService = DependencyResolver.Current.GetService<ILocalizationService>();
     _settingsService = DependencyResolver.Current.GetService<ISettingsService>();
     _UnitOfWorkManager = DependencyResolver.Current.GetService<IUnitOfWorkManager>();
     _permissionService = DependencyResolver.Current.GetService<IPermissionService>();
     _luceneService = DependencyResolver.Current.GetService<ILuceneService>();
 }
Exemple #19
0
 public ProductEventConsumer(ILuceneService luceneService)
 {
     _luceneService = luceneService;
 }
Exemple #20
0
        public CatalogModelFactory(BlogSettings blogSettings,
                                   CatalogSettings catalogSettings,
                                   DisplayDefaultMenuItemSettings displayDefaultMenuItemSettings,
                                   ForumSettings forumSettings,
                                   IActionContextAccessor actionContextAccessor,
                                   ICategoryService categoryService,
                                   ICategoryTemplateService categoryTemplateService,
                                   ICurrencyService currencyService,
                                   IEventPublisher eventPublisher,
                                   IHttpContextAccessor httpContextAccessor,
                                   ILocalizationService localizationService,
                                   IManufacturerService manufacturerService,
                                   IManufacturerTemplateService manufacturerTemplateService,
                                   IPictureService pictureService,
                                   IPriceFormatter priceFormatter,
                                   IProductModelFactory productModelFactory,
                                   IProductService productService,
                                   IProductTagService productTagService,
                                   ISearchTermService searchTermService,
                                   ISpecificationAttributeService specificationAttributeService,
                                   IStaticCacheManager cacheManager,
                                   IStoreContext storeContext,
                                   ITopicService topicService,
                                   IUrlHelperFactory urlHelperFactory,
                                   IUrlRecordService urlRecordService,
                                   IVendorService vendorService,
                                   IWebHelper webHelper,
                                   IWorkContext workContext,
                                   MediaSettings mediaSettings,
                                   VendorSettings vendorSettings,
                                   LuceneSettings luceneSettings, ILuceneService luceneService,
                                   ICacheKeyService cacheKeyService, ICustomerService customerService, IStaticCacheManager staticCacheManager)
            : base(blogSettings,
                   catalogSettings,
                   displayDefaultMenuItemSettings,
                   forumSettings,
                   actionContextAccessor,
                   cacheKeyService,
                   categoryService,
                   categoryTemplateService,
                   currencyService,
                   customerService,
                   eventPublisher,
                   httpContextAccessor,
                   localizationService,
                   manufacturerService,
                   manufacturerTemplateService,
                   pictureService,
                   priceFormatter,
                   productModelFactory,
                   productService,
                   productTagService,
                   searchTermService,
                   specificationAttributeService,
                   staticCacheManager,
                   storeContext,
                   topicService,
                   urlHelperFactory,
                   urlRecordService,
                   vendorService,
                   webHelper,
                   workContext,
                   mediaSettings,
                   vendorSettings)
        {
            _blogSettings    = blogSettings;
            _catalogSettings = catalogSettings;
            _displayDefaultMenuItemSettings = displayDefaultMenuItemSettings;
            _forumSettings                 = forumSettings;
            _actionContextAccessor         = actionContextAccessor;
            _categoryService               = categoryService;
            _categoryTemplateService       = categoryTemplateService;
            _currencyService               = currencyService;
            _eventPublisher                = eventPublisher;
            _httpContextAccessor           = httpContextAccessor;
            _localizationService           = localizationService;
            _manufacturerService           = manufacturerService;
            _manufacturerTemplateService   = manufacturerTemplateService;
            _pictureService                = pictureService;
            _priceFormatter                = priceFormatter;
            _productModelFactory           = productModelFactory;
            _productService                = productService;
            _productTagService             = productTagService;
            _searchTermService             = searchTermService;
            _specificationAttributeService = specificationAttributeService;
            _cacheManager     = cacheManager;
            _storeContext     = storeContext;
            _topicService     = topicService;
            _urlHelperFactory = urlHelperFactory;
            _urlRecordService = urlRecordService;
            _vendorService    = vendorService;
            _webHelper        = webHelper;
            _workContext      = workContext;
            _mediaSettings    = mediaSettings;
            _vendorSettings   = vendorSettings;
            _customerService  = customerService;
            _cacheKeyService  = cacheKeyService;

            _luceneSettings = luceneSettings;
            _luceneService  = luceneService;
        }
Exemple #21
0
 public MainViewModelController(MainWindowViewModel viewModel)
 {
     this.viewModel       = viewModel;
     sampleDataFileReader = new SampleDataFileReader();
     this.luceneService   = new LuceneService();
 }
 public AdminLuceneController(ILuceneService luceneService)
 {
     _luceneService = luceneService;
 }
Exemple #23
0
 public AdminLuceneController(ILuceneService luceneService)
 {
     _luceneService = luceneService;
 }
Exemple #24
0
 public ProvisionService(ILuceneService luceneService, IIndexer indexer)
 {
     this.luceneService = luceneService;
     this.indexer       = indexer;
 }