Exemplo n.º 1
0
        public TextProcessor(string text)
        {
            Input       = text;
            Input       = HttpUtility.HtmlDecode(Input);
            CurrentText = Input;
            CurrentText = CurrentText.StripHtml().ToStandard();

            var _models = CurrentText.ToWords();

            _models = _models.Where(t => t.IsWord()).ToArray();
            for (int i = 0; i < _models.Length; i++)
            {
                var _word = new Word(_models[i]);

                if (_word.CanRead())
                {
                    WordObject _object = new WordObject(_models[i], i);
                    _object.Indexs = CurrentText.IndexAll(_word.Value);
                    FullWordObjects.Add(_object);
                    _object.ToClean();
                    if (_object.IsClean())
                    {
                        CleanWordObjects.Add(_object);
                    }
                }
            }
            CountOfWords     = CleanWordObjects.Count;
            CountOfFullWords = FullWordObjects.Count;
            TimeToRead       = CountOfWords / 200; //Normal read speed
            LoadFull();
        }