18. [Activity] Improving the Word Count Script with Regular Expressions
IMPROVING WORD COUNT
Text Normalization
Activity
// Split using a regular expression that extracts words
val words = input.flatMap(x => x.split("\\W+")) // Normalize everything to lowercase
val lowercaseWords = words.map(x => x.toLowerCase())Previous17. [Activity] Counting Word Occurences using Flatmap()Next19. [Activity] Sorting the Word Count Results
Last updated