示例#1
0
        public IEnumerable <(string, string[])> ProcessWords(string[] inputWords)
        {
            var resultingSubstrings = new ConcurrentBag <(string, string[])>();

            Parallel.For(0, inputWords.Length, i =>
            {
                var processedWordParts = _wordBreaker.BreakWord(inputWords[i]);

                resultingSubstrings.Add((inputWords[i], processedWordParts));
            });
示例#2
0
        public IEnumerable <(string, string[])> ProcessWords(string[] inputWords)
        {
            List <(string, string[])> resultingSubstrings = new List <(string, string[])>();

            foreach (var word in inputWords)
            {
                var processedWordParts = _wordBreaker.BreakWord(word);

                resultingSubstrings.Add((word, processedWordParts));
            }

            return(resultingSubstrings);
        }