Beispiel #1
0
        public void Setup()
        {
            IDataService     data     = new DataService();
            IAnalyserService analyzer = new AnalyzerService(data);

            _analyseService = analyzer;
            _dataService    = data;
            _matches        = new List <string> {
                "match_one"
            };
        }
Beispiel #2
0
        public ContentModel Analysis()
        {
            if (string.IsNullOrEmpty(_analyserModel.Content))
            {
                return(new ContentModel());
            }

            if (_analyserModel.Content.StartsWith("http"))
            {
                _analyserService = new UrlAnalyserService(_analyserModel);
            }
            else
            {
                _analyserService = new TextAnalyserService(_analyserModel);
            }

            return(new ContentModel()
            {
                WordList = _analyserService.GetAllWords(),
                TagList = _analyserService.GetAllMetaTags(),
                LinkList = _analyserService.GetAllExternalLinks()
            });
        }