title: How To Create a Map of Vowel Combinations from Words in a Text File
body: <p>I need to aggregate vowel combinations of the words in a text file using Scala. For example if the text file was: 
  "This is a text file."</p>
  
  <p>The output would be something like
  (i,2)
  (a,1)
  (e,1)
  (ei,1)</p>
  
  <p>I am brand new to spark/scala so please forgive my ignorance.</p>
  
  <p>My current code:</p>
  
  <pre><code>val wordsFile = sc.textFile("test.txt");
  val flattenMap = wordsFile.flatMap(line =&gt; line.split(" "))
  </code></pre>
  
  <p>I've made a small vowel function to check each char, but I'm unsure how to properly implement it.</p>
  
  <pre><code>def isVowel(letter: Char): Boolean = {
  letter match {
  case 'a' =&gt; true;
  case 'e' =&gt; true;
  case 'i' =&gt; true;
  case 'o' =&gt; true;
  case 'u' =&gt; true;
  case _ =&gt; false;
  }
  </code></pre>
  
  <p>How might I iterate over each word in flattenMap and store the vowels in a new map? 
  Thank you.</p>