Exemple #1
0
        public Result <List <string> > TryGetWordsFromText(string input)
        {
            var          text            = textReader.TryReadText(input);
            const string notLetterRegexp = @"[^\'`\-A-Za-z]";

            return(text.Then(t =>
                             Result.Of(Regex.Split(t, notLetterRegexp, RegexOptions.Compiled)
                                       .Where(s => s.Length > 0)
                                       .ToList)));
        }
Exemple #2
0
        public List <string> TryGetWordsFromText(string input)
        {
            var text = textReader.TryReadText(input);

            if (text == null)
            {
                return(null);
            }
            var notLetterRegexp = @"[^\'`\-A-Za-z]";

            return(Regex.Split(text, notLetterRegexp, RegexOptions.Compiled)
                   .Where(s => s.Length > 0).ToList());
        }