1 00:00:01,180 --> 00:00:06,410 Consonant blends, also called consonant clusters, are two or three consonants 2 00:00:06,410 --> 00:00:11,840 that make a distinct consonant sound, as in the tr of treehouse. 3 00:00:11,840 --> 00:00:14,515 When a word starts with these consonant blends, 4 00:00:14,515 --> 00:00:19,755 then we want to take that first sound and move it to the end of the word. 5 00:00:19,755 --> 00:00:24,220 We're going to test these two and three consonant blends separately. 6 00:00:24,220 --> 00:00:27,396 A two-letter blend is called a digraph, and 7 00:00:27,396 --> 00:00:31,170 a three-letter blend is called a trigraph. 8 00:00:31,170 --> 00:00:32,170 Let's go back to our code. 9 00:00:33,290 --> 00:00:36,671 We're going to add a new test for digraphs. 10 00:00:40,792 --> 00:00:42,531 We can copy this test. 11 00:00:47,940 --> 00:00:52,429 And change convertDiagraphWordToPigLatin, 12 00:00:52,429 --> 00:00:55,800 our word will need to be a diagraph. 13 00:00:56,830 --> 00:00:57,981 We'll use treehouse. 14 00:01:02,090 --> 00:01:07,800 And our expected results will be eehousetray. 15 00:01:07,800 --> 00:01:09,660 Now we're ready to run our test. 16 00:01:11,840 --> 00:01:16,779 Our diagraph converson fails because our convert method is only 17 00:01:16,779 --> 00:01:19,531 using the first letter of the word. 18 00:01:19,531 --> 00:01:22,719 We need to update our convert method. 19 00:01:22,719 --> 00:01:26,491 We'll start by adding a digraph array to our class. 20 00:01:32,990 --> 00:01:35,642 Next, in our convert method, 21 00:01:35,642 --> 00:01:40,750 we're going to add a second variable, firstTwoLetters. 22 00:01:40,750 --> 00:01:44,642 Again, we can use a substring of the word. 23 00:01:44,642 --> 00:01:47,970 Start at the beginning and give 2 characters. 24 00:01:47,970 --> 00:01:50,583 Next, we'll add a conditional. 25 00:01:50,583 --> 00:01:54,732 We'll check if (in_array), 26 00:01:54,732 --> 00:01:59,768 we want to use the \$firstTwoLetters and 27 00:01:59,768 --> 00:02:07,696 check our \$this->, digraphs array. 28 00:02:09,360 --> 00:02:13,160 We can duplicate these two lines from creating a new word. 29 00:02:15,480 --> 00:02:20,210 Instead of starting after the first character, we'll start after the second. 30 00:02:20,210 --> 00:02:22,672 And we'll use first 2 letters. 31 00:02:24,929 --> 00:02:26,645 Then we'll add an else. 32 00:02:28,640 --> 00:02:32,050 Here we'll have our original conversion. 33 00:02:32,050 --> 00:02:38,380 Either way, we want to return the new word, let's run our test again. 34 00:02:38,380 --> 00:02:44,278 This time, we see that our tests pass, let's add a test for trigraphs next.